Calculates the difference between UTC and another time zone for a particular local time.
dateTime as DateTime, timeZone as TimeZone
) as TimeSpan
- dateTime as DateTime — The local time for which to calculate the UTC offset.
- timeZone as TimeZone — The local time zone.
— A time span representing the time zone's offset from UTC.
dim tz = TimeZoneFromName("America/New_York")
dim dt = DateTimeFromParts(2021, 3, 13, 0, 0, 0, 0)
dim offset = UtcOffset(dt, tz)