Zamrony P. Juhara wrote 9 lines
Yes, it works if I remove timezone part from pattern as suggested by
Santiago. This one works
adatetime := scanDateTime(
'ddd, dd mmm yyyy hh:mm:ss',
'Tue, 28 Apr 2020 10:11:12 GMT');
So i guess, we must convert timezone information to local timezone
manually.
yes.
In unit Dateutils
https://www.freepascal.org/docs-html/rtl/dateutils/index-5.html You have a lot of handy functions:
function UniversalTimeToLocal(
UT: TDateTime
<https://www.freepascal.org/docs-html/rtl/system/tdatetime.html>
):TDateTime
<https://www.freepascal.org/docs-html/rtl/system/tdatetime.html>;
function UniversalTimeToLocal(
UT: TDateTime
<https://www.freepascal.org/docs-html/rtl/system/tdatetime.html>;
TZOffset: Integer
<https://www.freepascal.org/docs-html/rtl/system/integer.html>
):TDateTime
<https://www.freepascal.org/docs-html/rtl/system/tdatetime.html>;
function LocalTimeToUniversal(
LT: TDateTime
<https://www.freepascal.org/docs-html/rtl/system/tdatetime.html>
):TDateTime
<https://www.freepascal.org/docs-html/rtl/system/tdatetime.html>;
function LocalTimeToUniversal(
LT: TDateTime
<https://www.freepascal.org/docs-html/rtl/system/tdatetime.html>;
TZOffset: Integer
<https://www.freepascal.org/docs-html/rtl/system/integer.html>
):TDateTime
<https://www.freepascal.org/docs-html/rtl/system/tdatetime.html>;
function UniversalTimeToLocal(
UT: TDateTime
<https://www.freepascal.org/docs-html/rtl/system/tdatetime.html>
):TDateTime
<https://www.freepascal.org/docs-html/rtl/system/tdatetime.html>;
function UniversalTimeToLocal(
UT: TDateTime
<https://www.freepascal.org/docs-html/rtl/system/tdatetime.html>;
TZOffset: Integer
<https://www.freepascal.org/docs-html/rtl/system/integer.html>
):TDateTime
<https://www.freepascal.org/docs-html/rtl/system/tdatetime.html>;
function GetLocalTimeOffset: Integer
<https://www.freepascal.org/docs-html/rtl/system/integer.html>;
Show quoted text 24 lines
Saludos
Santiago A.