UTCtoLocal (open)

Convert UTC time to local time

Syntax

LOADLIB "wh::util/localization.whlib";

DATETIME FUNCTION UTCtoLocal(DATETIME date, STRING timezone)

Parameters

DATETIME date

UTC date and time to convert

STRING timezone

The time zone to convert the UTC time to

Return value

DATETIME

Local date and time

Description

This function converts UTC (formerly GMT) time to local time, correcting for any summertime or daylight saving time modifications that are in effect at the specified time. Leap seconds are not taken into account. The timezone parameter should contain a time zone name as supported by zoneinfo, for example "CET", "UTC", "Europe/Amsterdam", or "America/New_York". The function GetAvailableTimeZoneNames can be used to get a list of available time zone names. Please note that time zone names are case-sensitive!