summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Patrick Hurst <phurst@mit.edu>2014-01-25 18:15:14 -0500
committerGravatar Patrick Hurst <phurst@mit.edu>2014-01-25 18:15:14 -0500
commit50a8f1ffa063388b6c7c43bf3ecd8c4d92c77cdc (patch)
treed86ed7957ca1f3e55e25762c84cb0b1a1546ac3f
parent031c575db2d6e79c3e3f78b4b80d4b1d27d8cf6d (diff)
Use localtime, not gmtime, for datetime functions.
-rw-r--r--src/c/urweb.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c
index 831b2452..4eb542df 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -3939,43 +3939,43 @@ uw_Basis_time uw_Basis_fromDatetime(uw_context ctx, uw_Basis_int year, uw_Basis_
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;
}