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

Re: datetime error?

From: Thomas Lockhart <lockhart(at)fourpalms(dot)org>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: datetime error?
Date: 2002-01-03 15:56:23
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
> > >  I start fix my bug with "YY vs. zero" in formatting.c, and before it
> > >  a see current CVS:
> > Hmm, is 2001-10-10 a daylight-savings transition day in your timezone?
>  No, it's daylight-savings independent. The interesting thing is that
>  you not see it. I found some things:
>  * it not happen for GMT timezone, but for others only (I test 'Japan'
>    and 'CET').
>  * the difference between to_date and to_timestamp is that to_date use
>    the timestamp_date() for conversion. And in the timestamp_date() is
>    used timestamp2tm() that output bad 'tm' struct.
>    The basic difference is that timestamp2tm() with right output do
>    code that call localtime() and timestamp2tm() with bad output skip
>    it, because 'tzp' is not defined ("if (tzp != NULL)" in this
>    timestamp2tm()).

Ah! Have you tried calling timestamptz_date() instead? That one allows
handling time zones internally. Before 7.2, timestamp_date() did handle
time zones, but now we have TIMESTAMP WITHOUT TIME ZONE and TIMESTAMP
WITH TIME ZONE so those internal routines changed out from under you.

                         - Thomas

In response to


pgsql-hackers by date

Next:From: pgsql-bugsDate: 2002-01-03 16:12:05
Subject: Bug #549: select table privilege in postgres allows user to create index on the table
Previous:From: Tom LaneDate: 2002-01-03 15:51:06
Subject: Re: PGSQL - FAQ 4.1

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