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

Matthew Smith matt at smiffytech.com
Tue Mar 25 03:41:36 UTC 2008


Quoth David Forbes at 2008-03-25 13:37...
...
> 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?

The problem with coding this stuff into your software is that it will be 
out of date no sooner have you hit 'compile'.  Whilst it would be cool 
to use the Zoneinfo database <http://en.wikipedia.org/wiki/Zoneinfo>, 
it's quite big (about half a Meg, IIRC) and would also require network 
access.

I'd be inclined to convert GPS time to UTC and then let the user set 
through the menu system their UCT offset in hours and minutes (I live in 
one of the daft half-hour timezones) and also DST start/end dates.  This 
gives you complete flexibility - which is required when the authorities 
keep messing around with their daylight-saving plans.

Anyone who hasn't seen David's scope clock stuff, it's seriously cool.

Cheers

M

-- 
Matthew Smith
Smiffytech - Technology Consulting & Web Application Development
Business: http://www.smiffytech.com/
Personal: http://www.smiffysplace.com/
LinkedIn: http://www.linkedin.com/in/smiffy




More information about the Time-nuts_lists.febo.com mailing list