diff --git a/src/builtin.c b/src/builtin.c index bf80c7ba9e..4f2bc407ae 100644 --- a/src/builtin.c +++ b/src/builtin.c @@ -1201,7 +1201,8 @@ static jv tm2jv(struct tm *tm) { jv_number(tm->tm_min), jv_number(tm->tm_sec), jv_number(tm->tm_wday), - jv_number(tm->tm_yday)); + jv_number(tm->tm_yday), + jv_number(tm->tm_isdst)); } #if defined(WIN32) && !defined(HAVE_SETENV) @@ -1422,12 +1423,9 @@ static int jv2tm(jv a, struct tm *tm) { TO_TM_FIELD(tm->tm_sec, a, 5); TO_TM_FIELD(tm->tm_wday, a, 6); TO_TM_FIELD(tm->tm_yday, a, 7); + TO_TM_FIELD(tm->tm_isdst, a, 8); jv_free(a); - // We use UTC everywhere (gettimeofday, gmtime) and UTC does not do DST. - // Setting tm_isdst to 0 is done by the memset. - // tm->tm_isdst = 0; - // The standard permits the tm structure to contain additional members. We // hope it is okay to initialize them to zero, because the standard does not // provide an alternative.