Search Postgresql Archives

Re: Postgres and timezones

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





2016-01-20 12:10 GMT+01:00 Steve Rogerson <steve.pg@xxxxxxxxxxxxxxxxx>:
Hi, this is wrong:

# select to_char('2016-01-20 00:00'::timestamp at time zone 'Europe/Lisbon',
'TZ');
 to_char
---------
 GMT
(1 row)


It should be WET, "Western European Time". Is there something I'm doing wrong?


Actually your input is now interpretted as being timezone Europe/Lisbon but to_char still converts it to a string for the timezone that is currently set on your connection. When I do  (my connection is set to Europe/Amsterdam)

select to_char('2016-01-20 00:00'::timestamp at time zone 'Europe/Lisbon', 'HH:MI TZ');

I get 01:00 CET because it has converted it from Europe/Lisbon to CET.

You can adjust the timezone which is used for display by to_char with 

set timezone='Europe/Lisbon';


Regards,
Eelke


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux