[fpc-pascal] DateTimeToStr: 2958466, 00 is not a valid TDatetime encoding, maximum value is 2958466, 00

silvioprog silvioprog at gmail.com
Wed May 27 21:17:41 CEST 2015


On Wed, May 27, 2015 at 3:46 PM, silvioprog <silvioprog at gmail.com> wrote:

> Hello,
>
> This code works fine in Delphi 7 / XE 7:
>
> var
>   D: TDateTime;
>   S: string;
> begin
>   D := MaxDateTime;
>   S := DateTimeToStr(D);
> end;
>
> Return: 12/31/9999 11:59:59 PM.
>
> But, in FPC (from trunk), I got a EConvertError:
>
> 2958466,00 is not a valid TDatetime encoding, maximum value is 2958466,00
>
> Is this a bug?
>
> PS: same problem using DateTimeToString directly.
>

Now I tested this code in FPC 2.6.4 and it worked fine, so it seems a bug
in FPC from trunk (Lazarus 1.5 rUnknown FPC 3.1.1 i386-win32-win32/win64).

-- 
Silvio Clécio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20150527/552e162a/attachment.html>


More information about the fpc-pascal mailing list