UTCTIMEOFFSET

Purpose:

Returns the time difference in seconds between local time and UTC.

Syntax:

UTCTIMEOFFSET(locdate, loctime, "timezone")

locdate

-

Optional. A string or series of dates, the local date. Defaults to the current date.

loctime

-

Optional. A string or series of times, the local time. Defaults to the current time.

"timezone"

-

Optional. A string, the local time zone. Defaults to the current time zone.

Returns:

A real, the number of seconds between the local date and time in the time zone and UTC.

Example:

utctimeoffset()

 

Returns the number of seconds between the current date and time in the current time zone and UTC.

Example:

utctimeoffset() / 3600

 

Returns the number of hours between the current date and time in the current time zone and UTC.

Example:

utctimeoffset("1-1-2024", "12:00:00", "America/New_York") / 3600

 

Returns -5, the number of hours between noon on January 1, 2024 in the US Eastern time zone and UTC.

Example:

utctimeoffset("1-1-2024", "12:00:00", "America/Los_Angeles") / 3600

 

Returns -8, the number of hours between noon on January 1, 2024 in the US Pacific time zone and UTC.

Example:

dt =  {{julstr("2024-11-03"), todstr("1:59:00")},

       {julstr("2024-11-03"), todstr("2:01:00")}};

 

W1: dt;setvunits(w0, "date", 1, 1);setvunits(w0, "time", 1, 2)

W2: utctimeoffset(W1, "America/Chicago") / 3600

 

W2 == {-5, -6}

 

W2 represents the UTC offsets in hours for the US Central Time Zone:

UTC−5 during Central Daylight Time (CDT)

UTC−6 during Central Standard Time (CST)

The transition from CDT to CST occurred on November 3, 2024, at 2:00 a.m.

Remarks:

UTC stands for Coordinated Universal Time and is a reference time for all time zones worldwide. UTC is historically linked to Greenwich Mean Time (GMT), but is more precise.

 

UTCTIMEOFFSET returns the number of seconds between a local date and time and UTC date and time. Divide the result by 3600 to obtain hours.

 

A positive offset indicates the time zone is ahead of UTC and a negative offset indicates the time zone is behind UTC.

 

The timezone string is case sensitive and should adhere to the IANA timezone identifiers available at:

 

https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

and:

https://www.iana.org/time-zones

 

If timezone is blank or "local", the local time zone is used.

See Also:

CLOCK

DATEOFFSET

DTDIFF

DTOFFSET

GETDT

GETTIME

TIMEOFFSET