convertTimeFromUtc
convertTimeFromUtc(utcTimestamp: TimeStamp): TimeStamp;
The convertTimeFromUtc method of the JadeTimeZone class converts a timestamp for the Coordinated Universal Time (UTC) time zone to a timestamp for the time zone of the receiver, accounting for daylight saving and any historical time zone information that is available.
The following example shows the use of the convertTimeFromUtc method that finds out what time it is in Rome right now.
example_convertTimeFromUtc();
vars
utcTimeStamp: TimeStamp;
romeTimeStamp: TimeStamp;
romeTimeZone: JadeTimeZone;
begin
utcTimeStamp := app.getUTCTime();
// Get the current UTC time
romeTimeZone := JadeTimeZone@createTimeZoneByName("Europe/Rome");
// Create a JadeTimeZone for Rome
romeTimeStamp := romeTimeZone.convertTimeFromUtc(utcTimeStamp);
write "The time in Rome right now is " & romeTimeStamp.String;
epilog
delete romeTimeZone;
end;
2020.0.01 and higher
