'type declarations for System time and timezoneinfo structures
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
Type TIMEZONEINFO
Bias As Long
StandardName As String * 32
StandardDate As SYSTEMTIME
StandardBias As Long
DaylightName As String * 32
DaylightDate As SYSTEMTIME
DaylightBias As Long
End Type
'win32 API calls. needed to declare timezoneinfo as unicode to translate return string to wchar
Declare Function getTimeZoneInfo& Lib "kernel32" Alias "GetTimeZoneInformation" (tzs As Unicode TIMEZONEINFO)
Declare Function setTimeZoneInfo% Lib "kernel32" Alias "SetTimeZoneInformation" (tzs As Unicode TIMEZONEINFO)
Sub Click(Source As Button)
'declare a timezoneinfo structure
Dim tz As TIMEZONEINFO
'call c call
rc&=getTimeZoneInfo(tz)
'display time zone
Msgbox tz.StandardName
End Sub
This was first published in July 2001