Converts local date time values to UTC date time values.
LOCAL2UTC(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. |
A string or series, the date and time of the input values in UTC.
local2utc()
Returns the current date and time as a string in UTC.
local2utc("1/1/2024", "12:00:00", "America/New_York")
Returns "1/01/2024 17:00:00", the corresponding UTC date time of noon on January 1, 2024 in the US Eastern time zone.
local2utc("1/1/2024", "12:00:00", "America/Los_Angeles")
Returns "1/01/2024 20:00:00", the corresponding UTC date time of January 1, 2024 in the US Pacific time zone.
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: local2utc(W1, "America/Chicago")
W2 contains the date time:
11/03/2024 6:59:00
11/03/2024 8:01:00
The values correspond to the UTC equivalents for US Central Time dates, accounting for the switch from Daylight Saving to Standard Time on November 3, 2024.
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: local2utc(W1, "America/Chicago")
W3: utc2local(W2, "America/Chicago")
Same as above, except W3 converts the UTC values in W2 back into local values. Both W1 and W3 contain:
11/03/2024 1:59:00
11/03/2024 2:01:00
W1: {ymdhms2dt(2024, 11, 3, 1, 59, 0), ymdhms2dt(2024, 11, 3, 2, 1, 0)}
W2: local2utc(W1, "America/Chicago")
W3: utc2local(W2, "America/Chicago")
Same as above, except the date and time values are entered in YMDHMS format. Both W1 and W3 contain:
11/03/2024 1:59:00
11/03/2024 2:01:00
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.
LOCAL2UTC converts local date and times within a specified time zone to UTC date and times.
The timezome string is case sensitive 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 UTC2LOCAL to convert UTC date time data to local date time.
See TZCONVERT to convert date time values to a target time zone.