How do you know if it's daylight savings?

how can you get the time zone information on whether or not the system is using daylight savings or not using visual basic?

Thanks
thydAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

thydAuthor Commented:
Edited text of question.
0
Erick37Commented:
Using API:
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'See the Timezone.zip example at
'http://www.mvps.org/vb/index2.html?samples.htm
Option Explicit
Private Const TIME_ZONE_ID_INVALID = (-1)
Private Const TIME_ZONE_ID_UNKNOWN = 0
Private Const TIME_ZONE_ID_STANDARD = 1
Private Const TIME_ZONE_ID_DAYLIGHT = 2

Private Type SYSTEMTIME
    wYear As Integer
    wMonth As Integer
    wDayOfWeek As Integer
    wDay As Integer
    wHour As Integer
    wMinute As Integer
    wSecond As Integer
    wMilliseconds As Integer
End Type

Private Type TIME_ZONE_INFORMATION
    Bias As Long
    StandardName(32) As Integer
    StandardDate As SYSTEMTIME
    StandardBias As Long
    DaylightName(32) As Integer
    DaylightDate As SYSTEMTIME
    DaylightBias As Long
End Type
Private Declare Function GetTimeZoneInformation Lib "kernel32" _
    (lpTimeZoneInformation As TIME_ZONE_INFORMATION) As Long

Private Sub Command1_Click()
    Dim lRet As Long
    Dim tzi As TIME_ZONE_INFORMATION
    lRet = GetTimeZoneInformation(tzi)
    Select Case lRet
    Case TIME_ZONE_ID_DAYLIGHT
        Debug.Print "Daylight Savings Time"
    Case TIME_ZONE_ID_STANDARD
        Debug.Print "Standard Time"
    Case TIME_ZONE_ID_UNKNOWN
        Debug.Print "Unknown Timezone"
    Case Else
        Debug.Print "GetTimeZone Failed"
    End Select
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
thydAuthor Commented:
Thank-you very much!


Thy
0
Erick37Commented:
You're welcome :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.