Daylight Savings Time 
Author Message
 Daylight Savings Time

 We need to determine if Daylight Savings Time is in effect based on
the current day.   Is there VB function or tool out there that already
does this?

--
James H. Robinson, III

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 Daylight Savings Time

Quote:
>  We need to determine if Daylight Savings Time is in effect based on
> the current day.   Is there VB function or tool out there that already
> does this?

You can use the following code.  It only gives you an answer based on the
current system time, rather than some arbitrary date & time that you
specify, but from your statement above, it looks like it will do what you
need.

'{Declarations}

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 Const TIME_ZONE_ID_INVALID = &HFFFFFFFF
Private Const TIME_ZONE_ID_UNKNOWN = 0
Private Const TIME_ZONE_ID_STANDARD = 1
Private Const TIME_ZONE_ID_DAYLIGHT = 2

'{in a function or sub}

Dim lResult As Long
Dim TZ      As TIME_ZONE_INFORMATION

lResult = GetTimeZoneInformation(TZ)

lResult will equal one of the TIME_ZONE_ID constants above.

--



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. time zones and daylight saving time

2. Standard Time or Daylight Savings Time

3. Standard v. Daylight Savings Time Function

4. Daylight Savings Time Error

5. Daylight Savings Time

6. Daylight Savings-Time bias

7. Daylight Savings Time dates

8. how to calculate daylight saving time ?

9. how to caculate daylight saving time....

10. Daylight Savings Time

11. Daylight saving time

12. Daylight Saving Time and computing difference between two dates

 

 
Powered by phpBB® Forum Software