Created
October 14, 2019 12:24
-
-
Save bero/7c854ba15d4fb3328b320baefb65d11e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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