Converts UTC date time values to local date time values.
UTC2LOCAL(utcdate, utctime, "timezone")
utcdate |
- |
Optional. A string or series of dates, the UTC date. Defaults to the current date. |
utctime |
- |
Optional. A string or series of times, the UTC 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 local date time.
utc2local()
Returns the current date and time as a string in UTC.
utc2local("1/1/2024", "12:00:00", "America/New_York")
Returns "1/01/2024 7:00:00", the corresponding local date time in the US Eastern time zone of noon on January 1, 2024 in UTC.
utc2local("1/1-2024", "12:00:00", "America/Los_Angeles")
Returns "1/01/2024 4:00:00", the corresponding local date time in the US Pacific time zone of noon on January 1, 2024 in UTC.
dt = {{julstr("2024/11/03"), todstr("6:59:00")},
{julstr("2024/11/03"), todstr("8:01:00")}};
W1: dt;setvunits(w0, "date", 1, 1);setvunits(w0, "time", 1, 2)
W2: utc2local(W1, "America/Chicago")
W2 contains the date time:
11/03/2024 1:59:00
11/03/2024 2:01:00
The values correspond to the local US Central Time equivalents, accounting for the switch from Daylight Saving to Standard Time on November 3, 2024 at 2:00 AM.
dt = {{julstr("2024/11/03"), todstr("6:59:00")},
{julstr("2024/11/03"), todstr("8:01:00")}};
W1: dt;setvunits(w0, "date", 1, 1);setvunits(w0, "time", 1, 2)
W2: utc2local(W1, "America/Chicago")
W3: local2utc(W2, "America/Chicago")
Both W1 and W3 contains the date time:
11/03/2024 6:59:00
11/03/2024 8: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.
UTC2LOCAL converts UTC date and times to local date and times within a specified time zone.
The timezone 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 LOCAL2UTC to convert local date time data to UTC date time.
See TZCONVERT to convert date time values to a target time zone.