[time-nuts] How best to compute local time from GPS

Mike S mikes at flatsurface.com
Tue Mar 25 08:54:55 EDT 2008


At 11:07 PM 3/24/2008, David Forbes wrote...
>2. If I have to store the time zone from the user's input, are the
>DST calculations reasonably straightforward these days?
>
>3. What weird time zone operations should it support, such as 15
>minute local offsets or oddball DST dates?
>
>4. In general, is it better to let the user turn DST on and off or
>try to do it automatically? (I live in Arizona, which doesn't worship
>DST, so I have no experience in this matter.)

There is a well accepted method of specifying time zone offset and 
summer time adjustments. It is much simpler than trying to parse an 
Olson timezone table (which has historical information to allow date 
and calculations, something not needed for a clock). It allows for the 
full range of rules, and you don't have to worry about updating a table 
should the rules change. This is called a IEEE 1003.1 POSIX timezone 
literal. A good description is contained in 
http://tools.ietf.org/html/draft-ietf-dhc-dhcpv6-opt-tz-00

To specify the timezone for the eastern US, including current daylight 
saving time rules, one would use 
TZ="EST5EDT4,M3.2.0/02:00:00,M11.1.0/02:00:00"




More information about the time-nuts mailing list