Discussion in 'Share Your Creations' started by alfcen, Oct 5, 2007.

  1. alfcen

    alfcen Well-Known Member Licensed User

    Hi everybody,
    Here are the routines for retrieving the Time Zone.
    Tested with PPC2003SE, not tested under WM5.x/6.x.
    Tested on desktop with XP Home Edition.
    Perhaps there is a more elegant solution involving less code.
    Please use or abuse:)
    (transferred from the Wishlist)

    Sub App_Start
      Bit.New1      'bitwise.dll
    End Sub

    Sub Globals
    Dim zti(0As Byte      'Array for binary data (PPC), registry entry is binary
    End Sub

    Sub GetTimeZone
    Dim m, i
    If CPPC = True Then
    For i = 3 To 0 Step -1
          m = m & 
    Return bit.HexToDec(m) / 60 * (-1)
        m = Reg.GetValue(
    "System\CurrentControlSet\Control\Tim eZoneInformation","ActiveTimeBias")
    Return m / 60 * (-1)
    End If 
    End Sub

    Sub GetDayLightSavingHour
    'for the desktop only
      Return Reg.GetValue("System\CurrentControlSet\Control\Tim eZoneInformation","StandardBias")
    End Sub
  2. dzt

    dzt Active Member Licensed User

    Hi Robert,


    Works OK for me (tested in two different WM5 devices).
  3. alfcen

    alfcen Well-Known Member Licensed User

    Hi Dimitris
    Thanks a lot for testing and your feedback. Good knowing everything works on various platforms.
  4. Roman

    Roman Member Licensed User

    cut & copy error

    :sign0098: :sign0161:

    You get error when you cut&paste on line nr 20:
    ....."rrentContolSet\Control\TimeZon eInformation".......
    shuld be

    Erel. Please change size of message window in forum.
    Last edited: Oct 8, 2007
  5. alfcen

    alfcen Well-Known Member Licensed User

    Sorry about that, Roman, I am using Japanese XP and the B4PPC editor switches from alphabet to Japanese mode after almost every Run, thus leaving double-byte characters behind. Fortunately, the compiler identifies them as syntax error, but hunting for a double-byte space is like looking for a needle in a haystack. :sign0080:

    Thanks for your feedback.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice