[fpc-pascal] Why has StrToDate() failing under FPC 2.3.1 (64bit)

Michael Van Canneyt michael at freepascal.org
Tue Oct 20 12:04:59 CEST 2009



On Tue, 20 Oct 2009, Graeme Geldenhuys wrote:

> On 20/10/2009, Michael Van Canneyt <michael at freepascal.org> wrote:
>>
>>  You make a common assumption, which is mistaken:
>>  StrToDate(DateToStr(date)) generally does not work.
>
> Crap!  And that is pretty much what the tiOPF unit test is testing for.
>
> So why is StrToDate() so different to Delphi? In Delphi, the above
> mentioned code works.

Pure coincidence.

See the help of StrToDate in Delphi, it works 100% the same - as documented.
Maybe they are more forgiving concerning the time part.

> And to make matters worse, the tiOPF code is compiled with "$mode
> delphi" enabled.

That should have no effect whatsoever.

Michael.



More information about the fpc-pascal mailing list