"For developers", "Server scripts", "Functions description", "Date and time", "LocalTimeToUTC0".
Converting local time value to UTC with Windows settings of local GMT shifting; rules for transition to summertime.
function LocalTimeToUTC(dt: double): double;
Parameter |
Type |
Value |
---|---|---|
dt |
double |
local computer date/time value from which you need to get UTC value. |
Date/time value.
var
dt: double;
begin
dt := Now;
mLogScript(' Local current time: ' + FormatDateTime('hh:nn:ss', dt), '');
mLogScript('Current time in UTC: ' + FormatDateTime('hh:nn:ss', LocalTimeToUTC(dt)), '');
end.
[16:30:51] (Log "LocalTimeToUTC"): Local current time: 16:30:51
[16:30:51] (Log "LocalTimeToUTC"): Current time in UTC: 14:30:51