You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since ParseIso does pattern matching on the cheap, it has several 'features' and bugs. One feature is that it only supports ISO8601 strings in 'extended format' (with all separators).
In this case, the offset is taken as 100 hours and so the output is the local time in zone UTC+1, 4 days 3 hours behind.
It's possible to support most of the various flavours of ISO 8601 strings using regular expressions, but this would be significant rewrite of ParseIso including a new library reference.
If you just want to support 'basic' offsets: in utcConverter or JsonConverter, find the ParseIso function. Change the last line of
Select Case UBound(utc_OffsetParts)
Case 0
utc_offset = TimeSerial(VBA.CInt(utc_OffsetParts(0)), 0, 0)
to
Dim OffsetHours As Long, OffsetMins As Long
Dim OffsetStr As String: OffsetStr = utc_OffsetParts(0)
If Len(OffsetStr) <= 2 Then OffsetStr = OffsetStr & "00"
OffsetMins = VBA.CInt(VBA.Right$(OffsetStr, 2))
OffsetHours = (VBA.CInt(OffsetStr) - OffsetMins) / 100
utc_Offset = TimeSerial(OffsetHours, OffsetMins, 0)
If this solves your problem, please close this issue here.
The text was updated successfully, but these errors were encountered: