[fpc-devel]StrToDateTime bug

Michail A.Baikov baikov at mosfilm.ru
Wed Nov 15 14:47:41 CET 2000


Sorry for bad english...

It's not bug, and your trouble.

In system set dateseparator as '.' (without quote) and you send to parser
date with '/' separator. Compiler parse with dateseparator ('.') and space '
' and not detect your customize separator.

May be you should:

1. Replace all customize separators (Ex. '/') on current system specific
('.' for me).
2. Use fpc function for set system dateseparator to your separator
3. Get dateseparator and replace your separator on dateseparator.

Choose :-)

2Devel: I think, we should make workaround ... :-/


----- Original Message -----
From: "Pavel Stingl" <stingp1.eti at mail.cez.cz>
To: "FPC mail" <fpc-devel at lists.freepascal.org>
Sent: Wednesday, November 15, 2000 3:26 PM
Subject: [fpc-devel]StrToDateTime bug


> Hi, I have found possible bug in SysUtils unit -
> function StrToDateTime returns null date ->
> this piece of code
>
> ---
> var
>   D : TDateTime;
>
> begin
>   WriteLn(ShortDateFormat);
>   D := StrToDateTime('1/1/2000');
>   WriteLn(DateTimeToStr(D));
>   WriteLn(DateTimeToStr(Now));
> end.
> ---
>
> returns:
>
> d/m/y
> 30-12-1899
> 15-11-2000 13:02
>
> I'm using 1.0.2 compiler, RedHat 7.0,
> what I know, this bug is in fpc 1.1 rtl too.
>
> ------------------------------------
> Pavel Stingl
> mailto: stingp1.eti at mail.cez.cz
> ------------------------------------
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel





More information about the fpc-devel mailing list