Skip to content

Instantly share code, notes, and snippets.

@bero
Created October 14, 2019 12:24
Show Gist options
  • Save bero/7c854ba15d4fb3328b320baefb65d11e to your computer and use it in GitHub Desktop.
Save bero/7c854ba15d4fb3328b320baefb65d11e to your computer and use it in GitHub Desktop.
program Project7;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
DateUtils;
const
cDateTime = '2019-10-10T12:00';
cDateTimeTZ = '2019-10-10T12:00+01:00';
var
vExpectedDateTime, vValue: TDateTime;
begin
try
Writeln('Locale timeoffset +03:00');
WriteLn;
Writeln(cDateTime + ' ISO8601ToDate(True) -> ' + DateTimeToStr(ISO8601ToDate(cDateTime, True)));
Writeln(cDateTime + ' ISO8601ToDate(False) -> ' + DateTimeToStr(ISO8601ToDate(cDateTime, False)));
Writeln(cDateTimeTZ + ' ISO8601ToDate(True) -> ' + DateTimeToStr(ISO8601ToDate(cDateTimeTZ, True)));
Writeln(cDateTimeTZ + ' ISO8601ToDate(False) -> ' + DateTimeToStr(ISO8601ToDate(cDateTimeTZ, False)));
readln;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment