Home > database >  PostgreSQL 9.6 Cast text datetime to timetamptz different results
PostgreSQL 9.6 Cast text datetime to timetamptz different results

Time:10-12

Why may I have different results of casting text datetime to timestamptz on my Postgres server?

enter image description here

The first date casts to 03, but the second one casts to 04. Why?

I have Postgres 9.6, my config:

datestyle = 'iso, mdy';
timezone = 'W-SU';
lc_time = 'ru_RU.UTF-8'

CodePudding user response:

There must be a daylight savings time change between these two dates, so that in your session time zone (determined by the current setting of the timezone parameter) a different UTC offset is used.

W-SU is an alias for Europe/Moscow, and Moscow changed from daylight savings time in the night from Oct 25 (Saturday) to Oct 26 (Sunday).

  • Related