# HG changeset patch # User Patrick Hurst # Date 1390691714 18000 # Node ID 2b95ecdd94eb4fb04de4af6a08e5fb4be70c1fad # Parent e90f218f2d4897a75d72d969ce3b961b680ab869 Use localtime, not gmtime, for datetime functions. diff -r e90f218f2d48 -r 2b95ecdd94eb src/c/urweb.c --- a/src/c/urweb.c Sat Jan 25 18:13:33 2014 -0500 +++ b/src/c/urweb.c Sat Jan 25 18:15:14 2014 -0500 @@ -3939,43 +3939,43 @@ uw_Basis_int uw_Basis_datetimeYear(uw_context ctx, uw_Basis_time time) { struct tm tm; - gmtime_r(&time.seconds, &tm); + localtime_r(&time.seconds, &tm); return tm.tm_year + 1900; } uw_Basis_int uw_Basis_datetimeMonth(uw_context ctx, uw_Basis_time time) { struct tm tm; - gmtime_r(&time.seconds, &tm); + localtime_r(&time.seconds, &tm); return tm.tm_mon; } uw_Basis_int uw_Basis_datetimeDay(uw_context ctx, uw_Basis_time time) { struct tm tm; - gmtime_r(&time.seconds, &tm); + localtime_r(&time.seconds, &tm); return tm.tm_mday; } uw_Basis_int uw_Basis_datetimeHour(uw_context ctx, uw_Basis_time time) { struct tm tm; - gmtime_r(&time.seconds, &tm); + localtime_r(&time.seconds, &tm); return tm.tm_hour; } uw_Basis_int uw_Basis_datetimeMinute(uw_context ctx, uw_Basis_time time) { struct tm tm; - gmtime_r(&time.seconds, &tm); + localtime_r(&time.seconds, &tm); return tm.tm_min; } uw_Basis_int uw_Basis_datetimeSecond(uw_context ctx, uw_Basis_time time) { struct tm tm; - gmtime_r(&time.seconds, &tm); + localtime_r(&time.seconds, &tm); return tm.tm_sec; } uw_Basis_int uw_Basis_datetimeDayOfWeek(uw_context ctx, uw_Basis_time time) { struct tm tm; - gmtime_r(&time.seconds, &tm); + localtime_r(&time.seconds, &tm); return tm.tm_wday; }