Results 1 to 2 of 2

Thread: Daylight Savings Time detection

Threaded View

  1. #2
    Fanatic Member Comintern's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln, NE
    Posts
    826

    Re: Daylight Savings Time detection

    Just found this trolling through the CodeBank and thought I'd post an API version of this in case anyone else needs it (much easier\faster).
    VB Code:
    1. Private Type TimeZoneInfo
    2.     Bias As Long
    3.     StandardName(63) As Byte
    4.     StandardDate(7) As Integer
    5.     StandardBias As Long
    6.     DaylightName(63) As Byte
    7.     DaylightDate(7) As Integer
    8.     DaylightBias As Long
    9. End Type
    10.  
    11. Private Const TIME_ZONE_ID_DAYLIGHT = 2
    12.  
    13. Private Declare Function GetTimeZoneInformation Lib "kernel32" (uTZ As TimeZoneInfo) As Long
    14.  
    15. Private Function IsDLSavings() As Boolean
    16.  
    17.     Dim uInfo As TimeZoneInfo, lReturn As Long
    18.    
    19.     lReturn = GetTimeZoneInformation(uInfo)
    20.  
    21.     If lReturn = TIME_ZONE_ID_DAYLIGHT Then
    22.         IsDLSavings = True
    23.     End If
    24.  
    25. End Function
    Last edited by Comintern; Nov 30th, 2006 at 10:43 PM. Reason: typo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width