Strange timezone in PostgreSQL timestamp conversion
This SQL:
select to_timestamp(extract(epoch from '0001-01-01 00:00:00'::timestamp))
produces this output:
0001-01-01 08: 06: 00 + 08: 06
I understand that it to_timestamp()
always adds a timezone, so an extra 8 hours and +8
in the timezone segment. But what is it :06
? And where did the extra 6 minutes come from?
EDIT
If I initially execute set local timezone to 'UTC';
then I get the expected results.
source to share
Before UTC was invented, each city had its own local time, mostly within a few minutes of each other.
Immediately after the standardization of time zones (and appropriate acceptance by all), the local times were set to the values we know today.
This is why you get these strange results for ancient dates, especially before 1900.
In fact, Taipei only changed from UTC+08:06
to UTC+08:00
on Jan 1 st 1896 , so the dates before it will be offset +08:06
.
If you set your timezone to UTC, this will not happen, mainly because UTC offset is zero and never changes.