summaryrefslogtreecommitdiff
path: root/src/timezone/strftime.c
diff options
context:
space:
mode:
authorTom Lane2017-04-30 19:13:51 +0000
committerTom Lane2017-04-30 19:14:15 +0000
commit96cad6f24e48adcb9eb0ba0eea4c6bc9b9ed84ff (patch)
tree0d94a61c314c0476f80c0b2111e0780404991364 /src/timezone/strftime.c
parent93a07a68eed76d36519ff17eb9bedc376f38e8c5 (diff)
Sync our copy of the timezone library with IANA release tzcode2017b.
zic no longer mishandles some transitions in January 2038 when it attempts to work around Qt bug 53071. This fixes a bug affecting Pacific/Tongatapu that was introduced in zic 2016e. localtime.c now contains a workaround, useful when loading a file generated by a buggy zic. There are assorted cosmetic changes as well, notably relocation of a bunch of #defines.
Diffstat (limited to 'src/timezone/strftime.c')
-rw-r--r--src/timezone/strftime.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/timezone/strftime.c b/src/timezone/strftime.c
index 4a0a01db651..ab8f60e9c8f 100644
--- a/src/timezone/strftime.c
+++ b/src/timezone/strftime.c
@@ -1,4 +1,4 @@
-/* Convert a broken-down time stamp to a string. */
+/* Convert a broken-down timestamp to a string. */
/*
* Copyright 1989 The Regents of the University of California.
@@ -44,7 +44,6 @@
#include <locale.h>
#include "private.h"
-#include "tzfile.h"
struct lc_time_T
@@ -452,11 +451,17 @@ _fmt(const char *format, const struct pg_tm * t, char *pt, const char *ptlim,
{
long diff;
char const *sign;
+ bool negative;
if (t->tm_isdst < 0)
continue;
diff = t->tm_gmtoff;
- if (diff < 0)
+ negative = diff < 0;
+ if (diff == 0)
+ {
+ negative = t->tm_zone[0] == '-';
+ }
+ if (negative)
{
sign = "-";
diff = -diff;