createTimeZoneByName

createTimeZoneByName(timeZoneName: String}: JadeTimeZone typeMethod;

The createTimeZoneByName method of the JadeTimeZone class takes the name in Internet Assigned Numbers Authority (IANA) format of the time zone specified in the timeZoneName parameter to represent the name of a time zone within the Windows registry and returns a JadeTimeZone object with properties that match that time zone.

The names used in the timeZoneName parameter are from the IANA database; that is:

https://data.iana.org/time-zones/tz-link.html

For a list of the world's time zones in the tz database (or tzdata), see:

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

For a list of the IANA database and Windows registry time zone mappings, see "Mapping IANA Database and Windows Registry Time Zones", in the following subsection.

To ensure that time zone information is consistent between different nodes, which may be running on different versions and update levels of Windows and therefore may have different time zone information in their registries, time zone information is taken from the registry of the device that is running the database server or single‑user node.

If the map‑transformed version of the time zone name specified in the timeZoneName parameter does not match a time zone specified in the Windows registry, exception 1469 (Time zone not found) is raised.

The following example shows the use of the createTimeZoneByName method that converts time between Rome and New York when the clock strikes 12.

example_createTimeZoneByName();
vars
    romeDate: Date;
    romeTime: Time;
    romeTimeStamp: TimeStamp;
    romeTimeZone: JadeTimeZone;
    newYorkTimeStamp: TimeStamp;
    newYorkTimeZone: JadeTimeZone;
begin
    romeTime.setTime(0,0,0,0); // Set the time in Rome to midnight
    romeDate.setDate(1,1,2020); // Set the day in Rome to the 1st of January 2020
    romeTimeStamp.setTime(romeTime);
    romeTimeStamp.setDate(romeDate);
    romeTimeZone := JadeTimeZone@createTimeZoneByName("Europe/Rome"); 
         // Create a JadeTimeZone for Rome
    newYorkTimeZone := JadeTimeZone@createTimeZoneByName("America/New_York"); 
        // Create a JadeTimeZone for New York 
    newYorkTimeStamp := romeTimeZone.convertTimeByTimeZone(romeTimeStamp, 
        newYorkTimeZone); // Convert the time for Rome zone to New York time
    write "The time in New York when the clock strikes twelve in Rome is 
        " & newYorkTimeStamp.String;
epilog
    delete romeTimeZone;
    delete newYorkTimeZone;
end;

2020.0.01 and higher