TimeZoneFromName Procedure

Looks up a TimeZone by name.
Declaration
function TimeZoneFromName(name as String) as TimeZone

Parameters

Return value

TimeZone — A time span representing the time zone's offset from UTC.

Possible error codes

Example

Code
dim tz = TimeZoneFromName("America/New_York")
dim dt = DateTimeFromParts(2021, 3, 13, 0, 0, 0, 0)
dim offset = UtcOffset(dt, tz)
print TotalHours(offset)
Output
-5