Search code examples
postgresqltimestamptimezonetimestamp-with-timezone

Different TimeZone outputs wrong values


I am wondering why I am getting different times from this post Post

set timezone to 'UTC';

SELECT timestamptz '2012-03-05 17:00:00+0';  
Expected :2012-03-05 17:00:00+00
Got : 2012-03-05 22:30:00

SET timezone TO 'Europe/Berlin';

SELECT '2012-03-05 17:00:00+0'::timestamptz;  
Expected :  2012-03-05 18:00:00+01
Got: 2012-03-05 22:30:00



SELECT timestamptz '2012-03-05 18:00:00+1';
Expected : 2012-03-05 17:00:00+00
Got : 2012-03-05 22:30:00

Solution

  • Actually I am using DBeaver as a DB IDE and there we need to do some adjustments in dbeaver.ini refer this post for more insight