From dfee517e54d27412e28481637ba7d763ec34face Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 29 Mar 2014 12:59:58 -0700 Subject: * lib.c (string_time): If possible, change the timezone in the struct tm from "GMT" to "UTC", so that the time_string_utc function will use UTC for the %Z format. --- ChangeLog | 6 ++++++ lib.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 47dc8873..3bbbceae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-03-29 Kaz Kylheku + + * lib.c (string_time): If possible, change the timezone in the + struct tm from "GMT" to "UTC", so that the time_string_utc + function will use UTC for the %Z format. + 2014-03-27 Kaz Kylheku Fix a bug arising from putting generation 1 objects into the diff --git a/lib.c b/lib.c index afcf1689..03760ef0 100644 --- a/lib.c +++ b/lib.c @@ -5666,6 +5666,11 @@ static val string_time(struct tm *(*break_time_fn)(const time_t *, struct tm *), if (break_time_fn(&time, &broken_out_time) == 0) return nil; +#if HAVE_TM_ZONE + if (strcmp(broken_out_time.TM_ZONE, "GMT") == 0) + broken_out_time.TM_ZONE = "UTC"; +#endif + if (strftime(buffer, sizeof buffer, format, &broken_out_time) == 0) buffer[0] = 0; -- cgit v1.2.3