On Tue, 25 Apr 2023 08:25:01 +0200 (CEST), Michael Van Canneyt via fpc-pascal <fpc-pascal@lists.freepascal.org> wrote:
> > >On Mon, 24 Apr 2023, Thomas Kurz via fpc-pascal wrote: > >> I always use ScanDateTime for such purposes: >> >> https://www.freepascal.org/docs-html/rtl/dateutils/scandatetime.html >> >> You can explicitly define the pattern. > >Correct. This is the only correct way to do this. > >StrToDateTime is very limited in what it accepts. > >Michael. Thanks, I did not know about this before, but now it is inserted in my code and works fine. :-) So now I can just specify the pattern of data to be scanned using the y, m, h, n and s letters. But I am adding 20 on front of the telegram value because that uses only a 2-digit year and I had problems on my new RPiZero until I added the two yy in front of the pattern making it a 4-char year and the 20 in front of the telegram. Then all works fine. -- Bo Berglund Developer in Sweden _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal