Has the daylight saving time rule changed, invalid C runtime library?

Some time ago, I put together a time library that could be used to develop relative times during the year for someone. At that time, I noted that he made a one-hour shift in both directions to switch to daylight saving time. It just occurred to me that Congress had changed the rules of daylight saving time . I do not remember to see any information about updates to eliminate changes in the algorithms. Does anyone have any information on this topic?

+3
source share
5 answers

Most Unix-like systems use the Olson tz database for time zone information:

http://www.twinsun.com/tz/tz-link.htm

Changes to the US time zone rules were implemented in the 2005l version of the tz database.

+3
source

For Visual Studio 2005 and earlier, Microsoft released updated versions of the C runtime libraries. More information can be found here .

+1
source

What platform are you working on?

Since Congress does not set rules for the whole world :), there is a mechanism for flexible definition of rules in Unix / Linux for a long time

See, for example, http://www.manpagez.com/man/8/zic/ for file format. Your specific system may require an updated definition for the new rules (if the distribution has not already been processed)

For Windows, MS creates some rules and releases updates when something changes.

For MacOs, I have no idea, but I believe that it inherits the Unix way of doing things.

But in all these cases, you don’t need to change the C library

+1
source

More generally, the C runtime uses internal data files to map from the internal time representation to the user's locale. These comparisons are regularly updated by their respective suppliers to comply with applicable law.

0
source

Since the internal clock must be set to UTC, daylight saving time is just a matter of changing the time zone. For example, in my region on October 26, my Mac switched from CEST (Central European Summer Time) to "normal" CET (Central European Time). My watch display has changed, but not computer time.

http://www.timeanddate.com/library/abbreviations/timezones/eu/cest.html

In fact, this means that you absolutely must save the datetime variables in UTC or in a proprietary format that takes into account the time zone. Therefore, simply writing the date and time as the string "YYYYMMDDHHMMSS" is an error awaiting the appearance.

0
source

All Articles