[fpc-pascal] Converting http date back to TDateTime

Santiago A. svaa at ciberpiula.net
Wed Apr 29 11:32:57 CEST 2020

El 29/04/2020 a las 04:44, Zamrony P. Juhara via fpc-pascal escribió:
> No it does not work. Docs says literal string needs to be quoted with "
> Zamrony P. Juhara
>     On Wed, Apr 29, 2020 at 9:37, Alexander Grotewohl
>     <alex at dcclost.com> wrote:
>     _______________________________________________
>     fpc-pascal maillist  - fpc-pascal at lists.freepascal.org
>     <mailto:fpc-pascal at lists.freepascal.org>
>     https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
This format works for me:
'ddd, dd mmm yyyy hh:nn:ss'
Fpc 3.04, windows 7, 32bits, and fpc 3.04, Linux, 64bits.

Some points:

  * "m" is allowed for minutes , nevertheless, I use for minutes "n",
    not "m".
  * I have suppressed the time zone information, I couldn't see how to
    set it in formatStrings, nevertheless, it ignores the GMT, or
    anything after time in input string with no error.
  * I think that the scanner ignores the character after weekday, it
    expects a separator, as long as it is not a "d" if will accept and
    skip anything. So the double quote after the three "d" of
    'ddd", "dd is ignored and everything breaks. It's a little confusing.
  * The weekday and month depend on you local.
  * using non-ascii characters breaks things. In Spanish Wednesday is
    "Miércoles" (e with acute accent) and Tuesday is "Martes": "mar, 28
    abr 2020" works, but "Mié, 29 Abr 2020" fails. I think that the
    problem is that é  uses two bytes in UTF-8, but scan only deals
    properly with single byte characters


Santiago A.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20200429/fb571b8d/attachment.html>

More information about the fpc-pascal mailing list