Re: LOCALTIMESTAMP has wrong time zone

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: JB(at)BlackSkyTech(dot)com
Cc: "'Kevin Grittner'" <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: LOCALTIMESTAMP has wrong time zone
Date: 2011-02-24 23:23:47
Message-ID: 1430.1298589827@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Jonathan Brinkman" <JB(at)BlackSkyTech(dot)com> writes:
> postgres(at)Cloud-DB1:~$ psql beta_cms_main -c "show timezone;"
> TimeZone
> ----------
> EST
> (1 row)

Hmmm ... you do realize that that setting will result in EST (GMT-5)
all year round? It's more likely that you want America/New_York.
That's not your immediate problem, though it might be a problem come
daylight savings time.

> postgres(at)Cloud-DB1:~$ psql beta_cms_main -c "select now();"
> now
> -------------------------------
> 2011-02-24 17:42:40.023498-05
> (1 row)

> postgres(at)Cloud-DB1:~$ psql beta_cms_main -c "select localtimestamp;"
> timestamp
> ----------------------------
> 2011-02-24 17:42:40.078052
> (1 row)

> All looks correct to me!

Well, that shows that you're getting the correct answer for
localtimestamp in psql, so if your application is getting different
answers, then you need to look into what it is that your application
is doing differently. Possibly you have some other value of timezone in
force in the application's sessions, or there's some conversion going
on in the client that you haven't told us about.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Greg Stark 2011-02-25 02:03:40 Re: Function trunc() behaves in unexpected manner with different data types
Previous Message Kevin Grittner 2011-02-24 22:58:47 Re: LOCALTIMESTAMP has wrong time zone