[fpc-pascal] Why has StrToDate() failing under FPC 2.3.1 (64bit)
Michael Van Canneyt
michael at freepascal.org
Tue Oct 20 12:21:08 CEST 2009
On Tue, 20 Oct 2009, Graeme Geldenhuys wrote:
> On 20/10/2009, Michael Van Canneyt <michael at freepascal.org> wrote:
>>
>> It is documented:
>
> and the documented example "ex19.pp" causes the same error!
>
> --------------------------
> $ cp /opt/fpcdocs_svn/sysutex/ex19.pp ex19.pas
> $ fpc ex19.pas
> Free Pascal Compiler version 2.3.1 [2009/10/08] for x86_64
> Copyright (c) 1993-2009 by Florian Klaempfl
> Target OS: Linux for x86-64
> Compiling ex19.pas
> Linking ex19
> 19 lines compiled, 0.1 sec
>
> $ ./ex19
> ShortDateFormat d/m/y
> 20-10-09 : 20-10-09
> An unhandled exception occurred at $000000000042D54F :
> EConvertError : "05/05/1999" is not a valid date format
> $000000000042D54F
> $00000000004002A1
> $0000000000400424
The error is correct, since 05/05/1999 is not a valid date.
It should use - instead of / . I've adapted the example.
Michael.
More information about the fpc-pascal
mailing list