NZDT Question

Started by Mike Cover 18 years ago3 messagesgeneral
Jump to latest
#1Mike C
smith.not.western@gmail.com

Hi,

I've just upgraded from Postgres 8.1.0 to 8.1.10 to update the NZ
timezone changes, but it doesn't seem to make a difference (I've also
patched linux). Ideas?

Below is how I'm testing (artificially set time into future):

-bash-3.1$ date
Mon Oct 1 07:12:36 NZDT 2007
-bash-3.1$ psql test
Welcome to psql 8.1.10, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

business=# select now();
now
-------------------------------
2007-10-01 06:12:40.097244+12
(1 row)

business=# select current_timestamp;
now
-------------------------------
2007-10-01 06:12:43.697349+12
(1 row)

Note the 1 hour difference between postgres and date.

Regards,

Mike

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Mike C (#1)
Re: NZDT Question

"Mike C" <smith.not.western@gmail.com> writes:

I've just upgraded from Postgres 8.1.0 to 8.1.10 to update the NZ
timezone changes, but it doesn't seem to make a difference (I've also
patched linux). Ideas?

Hm, works for me:

Welcome to psql 8.1.10, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

regression=# set timezone to 'Pacific/Auckland';
SET
regression=# select '2007-10-01 06:12:40.097244+12'::timestamptz;
timestamptz
-------------------------------
2007-10-01 07:12:40.097244+13
(1 row)

What have you got "timezone" set to? Did you remember to restart
the postmaster after updating?

regards, tom lane

#3Mike C
smith.not.western@gmail.com
In reply to: Tom Lane (#2)
Re: NZDT Question

On 9/26/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:

regression=# set timezone to 'Pacific/Auckland';
SET
regression=# select '2007-10-01 06:12:40.097244+12'::timestamptz;
timestamptz
-------------------------------
2007-10-01 07:12:40.097244+13
(1 row)

What have you got "timezone" set to? Did you remember to restart
the postmaster after updating?

Aha! Thanks... when I ran set timezone, it did not recognize
'Pacific/Auckland'. I hadn't installed share/timezone in correct
location. Works great now!

Cheers,

Mike