Daylight saving - winter time - summer time - time zone 
Author Message
 Daylight saving - winter time - summer time - time zone

How can I check in vb if it is summer time or winter time ?
Or how can I check in which timezone I am in vb ?

Can anyone please help me ?



Mon, 08 Mar 2004 23:00:32 GMT  
 Daylight saving - winter time - summer time - time zone
To determine if it is summertime or it is wintertime use following code:

Private Const TIME_ZONE_ID_UNKNOWN As Long = 1
Private Const TIME_ZONE_ID_STANDARD As Long = 1
Private Const TIME_ZONE_ID_DAYLIGHT As Long = 2
Private Const TIME_ZONE_ID_INVALID As Long = &HFFFFFFFF

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(0 To ((32 * 2) - 1)) As Byte  'unicode
   StandardDate As SYSTEMTIME
   StandardBias As Long
   DaylightName(0 To ((32 * 2) - 1)) As Byte  'unicode
   DaylightDate As SYSTEMTIME
   DaylightBias As Long
End Type

Private Declare Function GetTimeZoneInformation Lib "kernel32" _
    (lpTimeZoneInformation As TIME_ZONE_INFORMATION) As Long

Dim blnIsSummerTime As Boolean

blnIsSummerTime = IsDaylightSavingTime

Function IsDaylightSavingTime() As Boolean
   Dim tzi As TIME_ZONE_INFORMATION
   IsDaylightSavingTime = GetTimeZoneInformation(tzi) =
TIME_ZONE_ID_DAYLIGHT
End Function


Quote:
> How can I check in vb if it is summer time or winter time ?
> Or how can I check in which timezone I am in vb ?

> Can anyone please help me ?



Fri, 12 Mar 2004 18:10:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Daylight saving - winter time - summer time - time zone

2. Daylight saving - winter time - summer time - time zone

3. time zones and daylight saving time

4. Standard Time or Daylight Savings Time

5. Determining Time Zones or Server Time

6. Add Time zone to time received field in message

7. Time offset for Time Zone display?

8. Formatting Time to GMT when current Time Zone not known

9. Time & Time Zones

10. UTC time and Time Zones

11. Standard v. Daylight Savings Time Function

12. Daylight Savings Time Error

 

 
Powered by phpBB® Forum Software