LocalToUTC (open)

Convert local time to UTC time

Syntax

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

DATETIME FUNCTION LocalToUTC(DATETIME date, STRING timezone)

Parameters

DATETIME date

Local date and time to convert

STRING timezone

Time zone to convert the UTC time from

Return value

DATETIME

UTC date and time

Description

This function converts local time to UTC (formerly GMT) 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 not that time zone names are case-sensitive!