Re: how to show time zone with numerical offset in CSV log? - Mailing list pgsql-general

From Tom Lane
Subject Re: how to show time zone with numerical offset in CSV log?
Date
Msg-id 6681.1442935329@sss.pgh.pa.us
Whole thread Raw
In response to Re: how to show time zone with numerical offset in CSV log?  (Michael Zoet <Michael.Zoet@zoet.de>)
Responses Re: how to show time zone with numerical offset in CSV log?
List pgsql-general
Michael Zoet <Michael.Zoet@zoet.de> writes:
> Can you explain what '<-0400>+4' exactly means?

It's a POSIX-style zone name specifying the STD abbreviation "-0400",
UTC offset 4 hours west of Greenwich, and no DST behavior.

> And why the string
> '<+0200>-2' prints the date & time with the correct time and +0200 for
> my time zone CEST?

Same thing for 2 hours east of Greenwich.  Remember POSIX and ISO have
opposite sign conventions.

> And how can this automatically be changed if Germany switches from
> summer time (CEST with +0200) to winter time (CET +0100)?

Well, you could write <+0200>-2<+0100> but I'm not sure I would recommend
it.  That would result in switching on the DST transition days specified
in the "posixrules" timezone database file, which by default will be USA
not European rules.  You could replace the posixrules file with some
suitable European zone file, but that would be more invasive than you
might want (especially if the zone database is shared with non-Postgres
applications); and even if that's OK, it's practically certain you'd
forget to re-fix it after some future software update overwrites the zone
files.

The best compromise might be to just use <+0000>+0, ie force it to
print in GMT always.

            regards, tom lane


pgsql-general by date:

Previous
From: Michael Zoet
Date:
Subject: Re: how to show time zone with numerical offset in CSV log?
Next
From: Michael Zoet
Date:
Subject: Re: how to show time zone with numerical offset in CSV log?