module documentation
Parsing of Git's "approxidate" time specifications.
Git uses a flexible date parser called "approxidate" that accepts various formats for specifying dates and times, including: - Relative times: "yesterday", "2 days ago", "2.weeks.ago" - Absolute dates: "2005-04-07", "2005-04-07 22:13:13" - Unix timestamps: "1234567890" - Special keywords: "now", "today", "yesterday"
| Function | parse |
Parse a Git approxidate specification and return a Unix timestamp. |
| Function | parse |
Parse a relative time string like '2 weeks ago' into seconds. |
Parse a Git approxidate specification and return a Unix timestamp.
| Parameters | |
timestr | bytes | Time specification string. Can be: - A Unix timestamp (integer as string) - A relative time like "2 weeks ago" or "2.weeks.ago" - Special keywords: "now", "today", "yesterday" - Absolute date: "2005-04-07" or "2005-04-07 22:13:13" |
| Returns | |
int | Unix timestamp (seconds since epoch) |
| Raises | |
ValueError | If the time specification cannot be parsed |