# HG changeset patch # User Adam Chlipala # Date 1293657385 18000 # Node ID f294173d87db99c3b7710388ff37b445bad927ba # Parent 8cdd25f9cfd0cde664f8e601bcb941317b3bd680 Don't forget to call tzset() diff -r 8cdd25f9cfd0 -r f294173d87db src/c/urweb.c --- a/src/c/urweb.c Wed Dec 29 15:58:54 2010 -0500 +++ b/src/c/urweb.c Wed Dec 29 16:16:25 2010 -0500 @@ -3675,10 +3675,14 @@ uw_Basis_time *uw_Basis_readUtc(uw_context ctx, uw_Basis_string s) { struct tm stm = {}; - - if (strptime(s, TIME_FMT_PG, &stm) || strptime(s, TIME_FMT, &stm)) { + char *end = strchr(s, 0); + + if (strptime(s, TIME_FMT_PG, &stm) == end || strptime(s, TIME_FMT, &stm) == end) { uw_Basis_time *r = uw_malloc(ctx, sizeof(uw_Basis_time)); + + tzset(); stm.tm_hour -= timezone / (60 * 60); + r->seconds = mktime(&stm); r->microseconds = 0;