Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-05

DateTimeToStr: 2958466, 00 is not a valid TDatetime encoding, maximum value is 2958466, 00

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

silvioprog

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.

Silvio Clécio My public projects - github.com/silvioprog

Reply by email

silvioprog
to silvioprog
silvioprog wrote 22 lines
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

Reply by email

Michael Van Canneyt
to silvioprog: This code works fine in Delphi 7 / XE 7: var D: TDateTime; S: string; begin D :=…
silvioprog wrote 19 lines
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?

Yes. Please report it in the bugtracker.

Michael.

Reply by email

silvioprog
to Michael Van Canneyt

On Wed, May 27, 2015 at 6:22 PM, Michael Van Canneyt <

Show quoted text 28 lines
wrote: On Wed, 27 May 2015, silvioprog 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? > Yes. Please report it in the bugtracker. Michael.

Done:

http://bugs.freepascal.org/view.php?id=28195

Also sent the patch to fix the problem.

Thank you!

Silvio Clécio My public projects - github.com/silvioprog

Reply by email