Expand description
Git-compatible time conversion helpers (ported from Git’s date.c).
Constants§
Functions§
- atoi_
bytes - C
atoion a byte slice (optional leading sign for digits). - date_
overflows - empty_
tm - get_
time_ sec - Read
GIT_TEST_DATE_NOWif set, else current time (seconds). - gm_
time_ t - Apply Git’s
tzHHMM encoding to a UTC instant sogmtime_ryields wall-clock digits. - init_
tm_ unknown - is_
date_ known - local_
time_ ⚠tzoffset - Git’s
local_time_tzoffset— offset fortin the local zone, as HHMM encoding. - local_
tzoffset - Git’s
local_tzoffsetfor a UTC instant. - match_
string - maybeiso8601
- nodate
- parse_
timestamp_ prefix - Parse leading digits as base-10 (
strtoumax/ Git’sparse_timestamp). - skip_
alpha - time_
to_ ⚠tm time_to_tm— UTCtmfor display with explicittzoffset metadata.- time_
to_ ⚠tm_ local time_to_tm_local—localtime_rfor the currentTZenvironment.- tm_
to_ time_ t - Git’s
tm_to_time_t— likemktime, but without normalization oftm_wday/tm_yday.