Skip site navigation (1) Skip section navigation (2)

TO_CHAR(timestamptz,datetimeformat) wrong after DST change

From: "Jonathan Brinkman" <JB(at)BlackSkyTech(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: TO_CHAR(timestamptz,datetimeformat) wrong after DST change
Date: 2011-03-18 14:55:03
Message-ID: 004c01cbe57c$7d920ca0$78b625e0$@com (view raw or flat)
Thread:
Lists: pgsql-bugs
My TO_CHAR function is now an hour off thanks to Daylight Savings Time. 
The dates are correct (I'm in EST: TZ=-04) but my function now returns TIME
an hour early.
(prior to DST we were TZ=-05).

TIMESTAMPTZ data (v_dt): 2011-03-17 18:21:50-04
FUNCTION SNIPPET: to_char(v_dt, 'mm/dd/yyyy hh:mi AM')
FUNCTION RETURNS: 03/18/2011 09:21 AM
FUNCTION SHOULD RETURN: 03/18/2011 10:21 AM

postgres=# show time zone;
     TimeZone
------------------
 America/New_York
(1 row)



Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2011-03-18 15:41:43
Subject: Re: TO_CHAR(timestamptz,datetimeformat) wrong after DST change
Previous:From: Yura SokolovDate: 2011-03-18 08:22:11
Subject: Setting timezone: is it bug or intended?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group