If /etc/localtime is a softlink, then it is trivial to determine what timezone it actually is. If it is not a softlink, then you can calculate checksums of all the installed zoneinfo files (/usr/share/zoneinfo/* ?) against the checksum of /etc/localtime. Assuming that /etc/localtime is actually one of the currently installed timezones, you should be able to determine precisely which one it is (along with any aliases for that timezone). Simillarly, you can compare the checksum of /etc/localtime with the checksum of the equivalent timezone in the to-be-installed zoneinfo files to see if the current timezone has changed, and thus requires a restart of timezone-sensitive servers. As a further refinement, you may want to consider keeping track of when timezones split (e.g. when America/Argentina/Cordoba split off America/Argentina/Salta in 2008i) so that if a user is using a timezone so that split since they last upgraded, they can at least be warned that their local time may not be correct, and giving them a list of alternatives to choose from. -Scott On Fri, Nov 7, 2008 at 8:10 AM, Edwin Groothuis <edwin@mavetju.org> wrote:
<yoshito_umaoka <at> us.ibm.com> writes:
I am working on an issue related to Brazil timezone. Our code reads the DST rules from windows registry instead of tzdata.
My question is -- how do I determine whether the windows system has applied the latest timezone DST rules from the following registry? I don't know how to interpret the binary data
To access time zone rules used by Windows, you can use the API below -
For "freebsd-update" (binary FreeBSD base system patch and migration) I have been asked if it was possible to determine of which timezone the current installed file in /etc/localtime was, so people could have non-interactive updates with regarding to that. The timezone given by date(1) doesn't always give a good enough hint, specially not for me in Australia where EST is often confused by programs with the US version of EST...
Also, being able to compare the old /etc/localtime with the newly to be installed one gives a hint on whether or not this is an important one for this machine, i.e. if you have to restart long-running services (syslog, cron) which otherwise will not notice the DST change.
Consider it a feature request :-)
Edwin
-- Scott Atwood Cycle tracks will abound in Utopia. ~H.G. Wells