different date-time in base and in system

Started by Alexander Kuprijanovover 18 years ago2 messagesgeneral
Jump to latest
#1Alexander Kuprijanov
sanya-spb@list.ru

Hello

I see this problem:
========================
$ date; echo 'select CURRENT_TIME;' | psql MyBase
Fri Oct 12 14:51:10 MSD 2007
timetz
--------------------
10:51:11.031388+00
(1 row)
========================

Can you please help, what I must do to correct it

As I understand this is tomezone issue...

Where I can read about my issue

Thanks

--
Sidi kiel muso sub balailo

#2Richard Huxton
dev@archonet.com
In reply to: Alexander Kuprijanov (#1)
Re: different date-time in base and in system

Alexander Kuprijanov wrote:

========================
$ date; echo 'select CURRENT_TIME;' | psql MyBase
Fri Oct 12 14:51:10 MSD 2007
timetz
--------------------
10:51:11.031388+00

I'm currently at a +1 hour offset from UTC, so.

=> set time zone 'UTC';
SET
=> SELECT current_timestamp;
now
-------------------------------
2007-10-12 14:33:28.258005+00
(1 row)

=> reset time zone;
RESET
=> SELECT current_timestamp;
now
------------------------------
2007-10-12 15:33:34.17609+01
(1 row)

Can you please help, what I must do to correct it

As I understand this is tomezone issue...

See the manuals - the A-Z index has lots of entries for time-zones
including Ch 8.5.3, 43.48, 43.49

In particular this may be useful:

=> SELECT * FROM pg_timezone_names WHERE abbrev='MSD';
name | abbrev | utc_offset | is_dst
---------------+--------+------------+--------
Europe/Moscow | MSD | 04:00:00 | t
W-SU | MSD | 04:00:00 | t
(2 rows)

=> set timezone = 'Europe/Moscow';
SET
=> SELECT current_timestamp;
now
-------------------------------
2007-10-12 18:37:54.774167+04
(1 row)

HTH
--
Richard Huxton
Archonet Ltd