El 29/04/2020 a las 19:31, Zamrony P. Juhara via fpc-pascal escribió:
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>;




Thank you

Zamrony P. Juhara
https://v3.juhara.com
https://github.com/zamronypj

Fano Framework
https://fanoframework.github.io

mod_pascal
https://zamronypj.github.io/mod_pascal

    On Wed, Apr 29, 2020 at 16:40, Santiago A.
    <s...@ciberpiula.net> wrote:
    _______________________________________________
    fpc-pascal maillist  - fpc-pascal@lists.freepascal.org
    <mailto:fpc-pascal@lists.freepascal.org>
    https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


--
Saludos

Santiago A.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to