diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-03-29 12:59:58 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-03-29 12:59:58 -0700 |
commit | dfee517e54d27412e28481637ba7d763ec34face (patch) | |
tree | 9e7aa4734d503a45247d2e6db321cd09a6bc2c62 | |
parent | a0fe82344b2f8435676c1fb2d155ff0d13a0ef50 (diff) | |
download | txr-dfee517e54d27412e28481637ba7d763ec34face.tar.gz txr-dfee517e54d27412e28481637ba7d763ec34face.tar.bz2 txr-dfee517e54d27412e28481637ba7d763ec34face.zip |
* 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.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib.c | 5 |
2 files changed, 11 insertions, 0 deletions
@@ -1,3 +1,9 @@ +2014-03-29 Kaz Kylheku <kaz@kylheku.com> + + * 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 <kaz@kylheku.com> Fix a bug arising from putting generation 1 objects into the @@ -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; |