Announcement

Collapse
No announcement yet.

TIME_ZONE_INFORMATION

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • TIME_ZONE_INFORMATION

    'Type TIME_ZONE_INFORMATION
    ' Bias As Long
    ' StandardName As String * 64
    ' StandardDate As SYSTEMTIME
    ' StandardBias As Long
    ' DaylightName As String * 64
    ' DaylightDate As SYSTEMTIME
    ' DaylightBias As Long
    'End Type


    Of this information above...
    How does one calculate where we are in the year in relation to whether you are on Daylight savings time or not.

    This is for the NIST emulation function I am making
    According to NIST you must:

    TT is a two digit code (00 to 99) that indicates whether the United States is on Standard Time (ST) or Daylight Saving Time (DST). It also indicates when ST or DST is approaching. This code is set to 00 when ST is in effect, or to 50 when DST is in effect. During the month in which the time change actually occurs, this number will decrement every day until the change occurs. For example, during the month of October, the U.S. changes from DST to ST. On October 1, the number will change from 50 to the actual number of days until the time change. It will decrement by 1 every day until the change occurs at 2 a.m. local time when the value is 1. Likewise, the spring change is at 2 a.m. local time when the value reaches 51.

    So that's what I am trying to accomplish

    Scott

    -------------
    Scott
    mailto:[email protected][email protected]</A>
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

  • #2
    Scott,

    Check the return values from the GetTimeZoneInformation API function. I think this is what you're looking for.


    LOCAL tzInfo as SYSTEMTIME

    Result = GetTimeZoneInformation(tzInfo)
    MSGBOX STR$(tzInfo.Bias / 60) 'Display offset in hours

    Return Codes:

    TIME_ZONE_ID_STANDARD = The system is operating in the range covered by the StandardDate member of the TIME_ZONE_INFORMATION structure.

    TIME_ZONE_ID_DAYLIGHT = The system is operating in the range covered by the DaylightDate member of the TIME_ZONE_INFORMATION structure.




    ------------------
    Scott Wolfington
    [url="http://www.boogietools.com"]http://www.boogietools.com[/url]

    Comment


    • #3
      That brings up another Question!!???

      If I do this:
      GetSystemTime St 'WHere st is a SYSTEMTIME structure

      This is in GMT, is DST figured into this or do I have to use the bias to adjust the hour from it?????


      Here's the link for anyone interested, Thanks Scott!!

      http://msdn.microsoft.com/library/ps.../time_3lim.htm


      ------------------
      Scott
      mailto:[email protected][email protected]</A>
      Scott Turchin
      MCSE, MCP+I
      http://www.tngbbs.com
      ----------------------
      True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

      Comment


      • #4
        Systemtime is UTC (GMT). This is not affected by DST. Of course without using a GPS receiver or time server, the PC's time
        could be way off. A stand alone PC can easily be misconfigured and report inacurate time.

        Selecting the wrong time zone in winduz is a favourite way of having screwed up PC time on an average PC.

        Comment


        • #5
          True! But I took that into consideration alreayd, the server hits the Atomic clock as a client just before opening for server mode
          Now, the DST part comes in, I suppose windows knows if it's DST and sets it according to the GMT time I send it...


          Scott

          ------------------
          Scott
          mailto:[email protected][email protected]</A>
          Scott Turchin
          MCSE, MCP+I
          http://www.tngbbs.com
          ----------------------
          True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

          Comment

          Working...
          X