Ben Combee <[EMAIL PROTECTED]> wrote: > At 09:46 PM 3/22/2005, you wrote: >>I previously wrote : >> >> I'm implementing GPS support in my program (location tracking). >> As a >> side benefit, I would like to offer to set the device time with >> the UTC time received from the GPS. Now, in order to adjust UTC >> time to local time, I need to call TimUTCToTimeZone, which in >> turn requires the number of minutes east of UTC (or a negative >> amount if West of UTC), which I can get with PrefGetPreference >> and prefMinutesWestOfGMT... a UInt32 (unsigned) amount!
For values of prefMinutesWestOfGMT greater than 720, subtract 1440. That will give you the correct signed amount (I think). You could also use the GPS position to calculate the time zone; you probably wouldn't be off by more than an hour that way :) >> The >> prefTimeZone pref (an Int16) was later introduced with OS 4.0 and >> preferences version 9. What's the trick for PalmOS 3.0-3.5? > There is no trick with OS versions before 4.0. Those devices > didn't have a time zone setting, so unless you provide your own > time zone setting in your application, there's no way to convert > the device time to UTC accurately. What is prefMinutesWestOfGMT used for, then? How is it normally set -- by whatever apps need to use it? I was reading about this pref just this afternoon in Foster's book, and was wondering where it came from, since I didn't recall ever setting a time zone on OS 3.5. -- Ray -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
