Hello,

Here's a copy of the routine from the Carbon Declare Library(http:// jjlange.spymac.com/other1.html) that returns the number of seconds you need to add:

Function GetGMTOffset() As Integer
   // Code created by Mike Bailey <[EMAIL PROTECTED]>
   // Added 12/30/2001 by Kevin Ballard

   // 68k Compatible

   #if TargetCarbon then
      Declare Sub ReadLocation lib "CarbonLib" (location As ptr)
   #else
Declare Sub ReadLocation lib "InterfaceLib" (location As ptr) Inline68k("205F203C000C00E4A051")
   #endif

   Dim temp As MemoryBlock
   Dim gmtOffset As Integer

   temp = NewMemoryBlock(12)
   ReadLocation temp
   gmtOffset = temp.short(9) * 256 + temp.byte(11)

   If (gmtOffset < 0) Then
gmtOffset = ceil(gmtOffset / 3600) * 100 + ((gmtOffset \ 60) Mod 60)
   Else
gmtOffset = floor(gmtOffset / 3600) * 100 + ((gmtOffset \ 60) Mod 60)
   End

   Return gmtOffset
End Function

and an equivalent call for Windows from one of my old projects. Looks like I didn't bother to check if the GMT offset was less than zero:

  #if targetWin32 then

Declare Function GetTimeZoneInformation Lib "kernel32.dll" (TimeZoneInfo
    as Ptr) as integer

    timeZoneInfo = newMemoryBlock(172)
    tResult = GetTimeZoneInformation(timeZoneInfo)
    offset = -timeZoneInfo.long(0)\60
    return format(Offset * 100, "+0000")
  #endif

Thanks,
Navdeep Bains
Bains Software

On Dec 5, 2006, at 10:33 PM, Jeff Ayling wrote:




On 06/12/2006, at 4:47 PM, Peter Bozek wrote:

On 12/6/06, Jeff Ayling <[EMAIL PROTECTED]> wrote:
Hi All,

I am parsing the date_modified field in the iTunes xml file which
looks like this:

<key>Date Modified</key><date>2006-12-06T02:53:17Z</date>

Can anyone help to explain this format? At 2pm I made a change to
this track in iTunes which then created a new xml file with the date
above which is almost an hour out.

Does anyone know why the iTunes Date_modified field in the xml file
does not show the actual Date Modified? Or is it using a specific
Time Zone setting perhaps?

That Z at the end means that it is time in GMT (Zulu) time zone. Your
time offset is +11, and if you add 11 hours you get 2 pm (note that
the time in the key is 2:53 AM.)

--

Hey, thanks Tom and Peter.

I am in Sydney Australia:

Standard time zone:                     UTC/GMT +10 hours
Daylight saving time:                   +1 hour
Current time zone offset:               UTC/GMT +11 hours
Time zone abbreviation:         EST - Eastern Summer(Daylight) Time

So yes we get +11 hours.

Now I'll need a way to convert these 2006-12-06T02:53:17Z Time formats to the current time for the user on Mac/Win in different parts of the world. Is there a standard way RB users have done this in the past? I guess it means knowing the users time zone - a call to the system to get this info perhaps?

Cheers


Jeff



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



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

Reply via email to