On 12/30/2001 20:44, "Paul Scandariato" <paul_lists at intellisw dot com> wrote:
> Function OffsetFromGMT() As Integer
> dim tResult as integer
> dim info as memoryBlock
> dim offset as integer
>
> #if targetMacOS then
> #if targetCarbon then
> Declare Sub ReadLocation Lib "CarbonLib" (info As Ptr)
> #else
> Declare Sub ReadLocation Lib "InterfaceLib" (info As Ptr)
> Inline68k("205F203C000C00E4A051")
> #endif
>
> info = newMemoryBlock(12)
> ReadLocation info
> offset = info.Long(8)
> offset = BitwiseAnd(offset, &hFFFFFF)
> if offset > &h800000 then
> offset = offset - &h1000000
> end if
> offset = offset \ 3600
> return offset
> #endif
This won't take into account 'odd' offsets like New Delhi, +5:30...
--
Didier Barbas
Dilettante programmer and linguist
|