Re: to_timestamp returns the incorrect result for the DST fall over time.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gouse <gkhaji(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: to_timestamp returns the incorrect result for the DST fall over time.
Date: 2011-01-04 18:26:50
Message-ID: 12763.1294165610@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Gouse <gkhaji(at)gmail(dot)com> writes:
> I find that the to_timestamp giving the incorrect result for the DST time
> period.

On what grounds do you claim it's incorrect?

> select to_timestamp('2010-03-28 01:00:03 243','YYYY-MM-DD HH24:MI:SS.MS')
> results '2010-03-28 02:00:03.243 + 01' , I am not sure if this is correct.

The reason it does that is that actually there *is* no such local time
as 1:00:03 on that date. Clocks are supposed to jump from 1AM directly
to 2AM. PG's actual behavior is that the bogus time is interpreted as
standard time (UTC+0 in your case). The only other thing it could
plausibly do is throw an error, and that has been judged to be less
useful.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Walker 2011-01-04 19:29:30 Are CSV logs supported in the PgAdmin log viewer?
Previous Message Gouse 2011-01-04 17:17:05 to_timestamp returns the incorrect result for the DST fall over time.