FW: glibc, Linux: about the time zone transition values in the lo calt ime file

Yuming is not on the time zone mailing list; direct replies appropriately. --ado _____ From: Fei Yuming-CYF001 [mailto:Yuming.Fei@motorola.com] Sent: Tuesday, February 01, 2005 4:14 PM To: 'tz@elsie.nci.nih.gov' Subject: glibc, Linux: about the time zone transition values in the localt ime file Dear Sir: On Linux systems, it seems that the transitions stored in the localtime file are not the current time to start the transition, but the new local current time right after the transition. For example, I have the glibc-2.2.5 library on my Linux 2.4.20 system, my timezone is set to US/Central and my current time is in CST. The /etc/localtime (or /usr/share/zoneinfo/US/Central) shows that in 2005, the time to transfer into DST is 1112515200 seconds, i.e. Sun Apr 3 03:00:00 2005. (This can be got, e.g., by breaking into the glibc-2.2.5/time/tzfile.c's __tzfile_read() function, and printing out the transitions values, i.e. transitions[169] == 1112515200). However, as we know, the transition to DST is Apr 3 02:00:00 --> Apr 3 03:00:00. The time after the transition (i.e. 03:00:00) instead of the current time to start the transition (ie.. 02:00:00) has been stored in the localtime file. Could you please let me know what the reason it is to do so (i.e. why not storing 02:00:00)? I will highly appreciate your help! Yuming

"Olson, Arthur David (NIH/NCI)" wrote on 2005-02-03 13:57 UTC: Fei Yuming <Yuming.Fei@motorola.com> wrote:
On Linux systems, it seems that the transitions stored in the localtime file are not the current time to start the transition, but the new local current time right after the transition.
The following might help to clarify what I suspect you might got confused about: The transition times are stored in the "Seconds Since The Epoch (time_t)" time scale, which itself (like UTC) has *no* DST transitions. The effect you observed occured only *after* the application of the time_t->local-broken-down-time conversion, which you applied to convert the time_t value back into a human-consumable local-time yyyy-mm-dd hh:mm:ss display. It is only natural, that the transition time point itself is displayed using the same convention as the time point immediately afterwards. [By the way: This is for the same reason for which most digital clocks show 00:00 and not 24:00 at the midnight transition. Note that 24:00 would be valid only for the infinitesimal point in time at exactly midnight (and therefore invisible to the human eye), whereas 00:00 is a valid truncation until 00:01 is reached. Therefore, we use the backwards-looking notation 24:00 only when we refer to the end of a time interval (as in tonight 22:00-24:00), but not when we refer to the current time (as in "It is now 00:00.").] Markus -- Markus Kuhn, Computer Lab, Univ of Cambridge, GB http://www.cl.cam.ac.uk/~mgk25/ | __oo_O..O_oo__
participants (2)
-
Markus Kuhn
-
Olson, Arthur David (NIH/NCI)