changeset 1982:2b95ecdd94eb

Use localtime, not gmtime, for datetime functions.
author Patrick Hurst <phurst@mit.edu>
date Sat, 25 Jan 2014 18:15:14 -0500
parents e90f218f2d48
children 0ff4f64b4309
files src/c/urweb.c
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }