Converting Greenwich Mean Time
Quote:
> I need help with the conversion of "Greenwich Mean Time" to Eastern
> time? Any sample functions would be great!
Andrew, it is 5 hours during EST and 4 hours during EDT. I suppose you
are aware of the GetSystemTime (GMT) and GetLocalTime(Local Time) API
calls?
Private Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As
SYSTEMTIME)
Private Declare Function GetTimeZoneInformation Lib "kernel32"
(lpTimeZoneInformation As TIME_ZONE_INFORMATION) As Long
Private Declare Function SetTimeZoneInformation Lib "kernel32"
(lpTimeZoneInformation As TIME_ZONE_INFORMATION) As Long
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 gmtDT as SYSTEMTIME
private localDT as SYSTEMTIME
private timeZone as TIME_ZONE_INFORMATION
private function cvtGmt2LocalTime(GMT as date) as date
'Use the VB Datediff function to give you the local time.
'If you are in EASTERN time zone, this is straightforward
'If you're in another TIME zone, you see where i'm going I hope.
'
' GetSystemTime fills your structure with GMT stuff.
' GetLocalTime fills your structure with Local stuff.
'
end function
Havagud1,
Ron