| To: | "REALbasic Plugins" <realbasic-plugins at lists dot realsoftware dot com> |
|---|---|
| Subject: | Re: getting the correct GMT offset for a given date |
| From: | Thomas Tempelmann <listuser at tempel dot org> |
| Date: | Fri, 25 Feb 2005 09:44:52 +0100 |
| Delivered-to: | realbasic-plugins at lists dot realsoftware dot com |
This is a code snippet from my Joliet code, which is not Carbon, though:
// get the GMT offset
MachineLocation loc;
ReadLocation (&loc); // careful: must not be called from interrupts
(or
from most File Mgr calls)!
long tmpGMTDelta;
Boolean tmpGMTknown;
if ((loc.latitude | loc.longitude) != 0) {
// sign-extend the 3 byte GMT value into a long:
tmpGMTDelta = loc.u.gmtDelta & 0x00FFFFFF;
if (tmpGMTDelta & 0x00800000) {
tmpGMTDelta |= 0xFF000000;
}
tmpGMTknown = true;
} else {
tmpGMTDelta = 0;
tmpGMTknown = false;
}
gmtDeltaSec = tmpGMTDelta;
gmtDeltaKnown = tmpGMTknown;
Maybe this works in Carbon, too.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | getting the correct GMT offset for a given date, Norman Palardy |
|---|---|
| Next by Date: | Re: getting the correct GMT offset for a given date, Charles Yeomans |
| Previous by Thread: | Re: getting the correct GMT offset for a given date, Norman Palardy |
| Next by Thread: | Re: getting the correct GMT offset for a given date, Norman Palardy |
| Indexes: | [Date] [Thread] [Top] [All Lists] |