You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let make_from_gmt year mon day h m s =
let diff = fst (mktime (gmtime 0.)) in
make year mon day h m s -. diff
where make calls Unix.mktime. I think it is wrong. Since Japan Standard Time has no summertime since 1952 and its timezone is fixed, the code above works for the posix Unix epochs if your timezone is set to JST. But it does not world wide.
diff is intended to be the diff seconds between UTC and the local time, but it is not universal in general. diff is just the epoch diff between 1970/01/01T00:00:00Z (UTC) and 1970/01/01 00:00:00 of the local time.
The diff seconds between UTC and the local time of diffrent year-mon-day h:m:s can be diffrent.
let f t = fst (Unix.mktime (Unix.gmtime t)) -. t
If you are in Singapore,
f 0.0 = -27000.0
but
f (Unix.time ()) = -28800.0
You have 30min difference. This is due to the historical timezone change of SGT near 1981.
The text was updated successfully, but these errors were encountered:
The code looks like:
where
make
callsUnix.mktime
. I think it is wrong. Since Japan Standard Time has no summertime since 1952 and its timezone is fixed, the code above works for the posix Unix epochs if your timezone is set to JST. But it does not world wide.diff
is intended to be the diff seconds between UTC and the local time, but it is not universal in general.diff
is just the epoch diff between 1970/01/01T00:00:00Z (UTC) and 1970/01/01 00:00:00 of the local time.The diff seconds between UTC and the local time of diffrent
year-mon-day h:m:s
can be diffrent.If you are in Singapore,
but
You have 30min difference. This is due to the historical timezone change of SGT near 1981.
The text was updated successfully, but these errors were encountered: