www.delorie.com/djgpp/v2faq/faq190.html | search |
| Previous | Next | Up | Top |
One case where the time stamps might be very important is when you need to rebuild some package with Make. Make uses file time stamps to decide which files need to be rebuilt. Another case is if you distribute some files compressed with Zip and want your recipients to be able to restore the correct time stamps of your files when they unzip them.
If you don't care about file time stamps being incorrect in such cases, you can delete all those files and never look back.
You might wonder why we need all these zoneinfo files when the UTC offset is required. Well, the simplest way to tell programs what the UTC offset is, is to have the user specify a single
number which is the offset; but then this number needs to be changed twice a year, to accommodate for the daylight saving time. Another, not-quite-so-simple way is to have the user specify the
current UTC offset and the DST rules; but this is a tedious and error-prone process, and many users get it wrong. Both of these methods have the drawback that if the rules change, programs
misinterpret old time-stamps, since they treat them according to new rules. Using a table that is read from a file and includes the offset calculation rules for every year avoids all these problems
and requires the user to point the TZ
environment variable to the file that is pertinent to his/her time zone, which is easy:
set TZ=c:/djgpp/zoneinfo/israelor
set TZ=c:/djgpp/zoneinfo/us/alaskaTo find the rule suitable for your location, look into the src subdirectory of zoneinfo and browse the file whose name is your continent/part of the world. If no binary file exists with the name of your zone, you can create one with using the time-zone compiler zic, whose source is available in the v2/djlsr201.zip file, with the rest of DJGPP.
A public domain time-zone database exists, and is updated from time to time with the latest world-wide changes to the offset calculation rules. (The rules change because politicians in different countries make laws that change the local clock settings.) The contents of the zoneinfo directory which comes with DJGPP is based on this database, but if you want the latest rules, you can download them from the net as tzdata*.tar.gz; tzcode*.tar.gz in the same directory includes the programs that can be used to generate the offset tables from their source in tzdata*.tar.gz, the latest implementations of POSIX library functions that use time-zone information, and the man pages that document the rules and the software. The last update as of this writing was in May 1998.
On any single machine, you don't need more than a single file from that directory, which is the file for your time zone; once you find that file, you can safely delete the rest. But if you distribute a program that uses the TZ setting, you will have to include all of the files, or tell your users how to get and install them.
webmaster donations bookstore | delorie software privacy |
Copyright ⌐ 1998 by Eli Zaretskii | Updated Sep 1998 |
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)