Mysql from_timestamp (0) does not match my current time

My time zone is UTC + 8, but when I start

mysql> select from_unixtime(0); +---------------------+ | from_unixtime(0) | +---------------------+ | 1970-01-01 07:30:00 | +---------------------+ 

I got "1970-01-01 07:30:00" instead of "1970-01-01 08:00:00".

I ran:

 show variables like "%time_zone%"; 

Then I got:

 system_time_zone +08 time_zone SYSTEM 
+5
source share
1 answer

Assuming you are in Singapore, the time zone in this area in 1970 was GMT +7.5. Only in 1982, the current value of GMT +8 was used.

 Period in use Time offset from GMT Reference Meridian Name of Time ... 1905 May 31 + 6hr 55m 25s 103 51 16 E Singapore Mean Time 1905 Jun 01 - 1932 Dec 31 + 7hr 00m 00s 105 00 00 E Standard Zone Time 1933 Jan 01 - 1941 Aug 31 + 7hr 20m 00s 110 00 00 E Daylight Saving Time 1941 Sep 01 - 1942 Feb 15 + 7hr 30m 00s 112 30 00 E Daylight Saving Time 1942 Feb 16 - 1945 Sep 12 + 9hr 00m 00s 135 00 00 E Tokyo Standard Time @ 1945 Sep 13 - 1981 Dec 31 + 7hr 30m 00s 112 30 00 E DST/MST/SST # @ 1982 Jan 01 - Present + 8hr 00m 00s 120 00 00 E Singapore Standard Time 

http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html

+1
source

Source: https://habr.com/ru/post/1269398/


All Articles