Re: different date-time in base and in system - Mailing list pgsql-general

From Richard Huxton
Subject Re: different date-time in base and in system
Date
Msg-id 470F86F5.6090600@archonet.com
Whole thread Raw
In response to different date-time in base and in system  (Alexander Kuprijanov <sanya-spb@list.ru>)
List pgsql-general
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

pgsql-general by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: Query problem
Next
From: "Scott Marlowe"
Date:
Subject: Re: not work in IE