Chris Apers wrote:
Is this the good way to do this ?

I guess that depends on what "this", i.e. what you're trying to do.
I'm guessing convert between GMT and local time?

 if (romVersion >= sysMakeROMVersion(4,0,0,sysROMStageRelease,0))
    secs += (PrefGetPreference(prefTimeZone) +
PrefGetPreference(prefDaylightSavingAdjustment)) * 60;
 else
    secs += (PrefGetPreference(prefMinutesWestOfGMT) - 720) * 60; // no sure
about this one

I've haven't tried it myself, but the API docs make it look like you
would use PrefGetPreference() to get the time zone and the DST
adjustment, then use TimTimeZoneToUTC() and TimUTCToTimeZone() to
convert the time in seconds between the two.

I think on OS versions before 4.x, the clock is in local time so
there is no way to convert to UTC and back.  Hopefully someone will
correct me if I'm wrong about that.

  - Logan

--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to