Re: date_part returns wrong day for 1974-04-28 - Mailing list pgsql-bugs

From Phil Steinke
Subject Re: date_part returns wrong day for 1974-04-28
Date
Msg-id 20010409183017.B5312@clarkhall.ca
Whole thread Raw
In response to Re: date_part returns wrong day for 1974-04-28  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
List pgsql-bugs
* Thomas Lockhart was mumbling about..
> You are likely running across a "known feature" in PostgreSQL for
> versions before the almost-here v7.1. I do not know which time zone you
> are running in (need that info!) but in the US Pacific Time Zone

Aha..  I'm in Eastern (Canada), and doing this for any switch from EST to
EDT causes the problem.. e.g. April 1st of this year:

=> select timestamp(date('2001-04-01'));
       timestamp
------------------------
 2001-03-31 23:00:00-05
(1 row)

This skewed timestamp then gives the wrong day for the date_part.  I think
that time switches in EST/EDT are supposed to happen at 2am, not midnight,
to help avoid this kind of thing.

Phil

pgsql-bugs by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: date_part returns wrong day for 1974-04-28
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: Loss of significant digits on pg_dump