diff options
-rw-r--r-- | lib.c | 10 | ||||
-rw-r--r-- | txr.1 | 10 |
2 files changed, 19 insertions, 1 deletions
@@ -9770,9 +9770,17 @@ val make_time(val year, val month, val day, #if HAVE_STRPTIME +static struct tm epoch_tm(void) +{ + struct tm ep = { 0 }; + ep.tm_year = 70; + ep.tm_mday = 1; + return ep; +} + val time_parse(val format, val string) { - struct tm tms = { 0 }; + struct tm tms = epoch_tm(); const wchar_t *w_str = c_str(string); const wchar_t *w_fmt = c_str(format); char *str = utf8_dup_to(w_str); @@ -38756,6 +38756,16 @@ argument follows the same conventions as the POSIX C library function .codn strptime . +Prior to obtaining the time from +.meta format +and +.meta string +the returned structure is created and initialized +with a time which represents time 0 ("the epoch") +if interpreted in the UTC timezone as by the +.meta time-utc +method. + Note: the availability of .code time-parse depends on the availability of |