realbasic-plugins
[Top] [All Lists]

Re: getting the correct GMT offset for a given date

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: getting the correct GMT offset for a given date
From: Norman Palardy <palardyn at shaw dot ca>
Date: Fri, 25 Feb 2005 08:57:51 -0700
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
References: <S dot 0000461465 at mail dot tempel dot org>

On Feb 25, 2005, at 1:44 AM, Thomas Tempelmann wrote:

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.

Yeah. That works for getting the current GMT offset and I've been trying to figure out how to twist it to tell me the GMT offset for an arbitrary date.

But, it turns out that, after careful consideration, I need to change the non-Mac code and not the mac code.

I've been staring at my monitor too long ... I can tell

_______________________________________________
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>