Hello everyone!
Is there a way to make the following routine atomic, so it will yield the correct results even when a switch between standard time/winter time and daylight saving time/summer time happens in the middle of it?
uses
System.DateUtils,
System.SysUtils;
procedure GetUTCAndLocalNow(var UTC, Local: TDateTime);
begin
Local := Now;
UTC := TTimeZone.Local.ToUniversalTime(Local);
end;
Ultimately I am looking for the UTC and the local time values to be ISO 8601 formatted strings and I am not bound to TDateTime as given in the above routine.