Hi all,
I currently use the code below to get the UTC offset between my system time/date and the UTC time/date
Public Declare PtrSafe Sub GetSystemTime Lib "Kernel32" (ByRef lpSystemTime As U)
Public Type U
Ye As Integer: Mo As Integer: WD As Integer: Da As Integer: Hr As Integer: Mn As Integer: Se As Integer: Ms As Integer
End Type
Sub GetUTCOffset()
Dim nU As U, UD As Date
Call GetSystemTime(nU)
UD = nU.Ye & "-" & nU.Mo & "-" & nU.Da & " " & nU.Hr & ":" & nU.Mn & ":" & nU.Se
Debug.Print Format(Now - UD, "HH:NN")
End Sub
This works great - for "right now" and returns 2hrs in my timezone.
But due to daylight saving time being different across the world, if I take let's say the 2hr offset and apply it for something I plan in November, it'll be wrong (as it'll be 1hr by then).
Is there an _easy_ way to check the UTC offset for different dates?
Thanks!
Bookmarks