Sign in Join

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

Mailing lists / fpc-devel / 2002-05

1.0.6 sysutils bug

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Alejandro Néstor Vargas

I just fund a problem in sysutils shipped with fpc version 1.0.6-beta [2002/04/30].

The function FormatDateTime always returns 5 for the minutes.

This is an example:

uses sysutils;
begin
Writeln(FormatDateTime('YYYYMMDD hhmmss',now));
end.

tmp]$ ./a
20020520 140517

tmp]$ date
lun may 20 14:31:17 ART 2002

Alejandro Néstor Vargas ICQ: 20528995. Departamento de Desarrollo X Net Cuyo S.A.

Reply by email

Pierre Muller
you wrote 11 lines
I just fund a problem in sysutils shipped with fpc version 1.0.6-beta [2002/04/30]. The function FormatDateTime always returns 5 for the minutes. This is an example: uses sysutils; begin Writeln(FormatDateTime('YYYYMMDD hhmmss',now)); end.

You have to use nn for minutes, not mm!

Writeln(FormatDateTime('YYYYMMDD hhnnss',now));
should work correctly
Show quoted text 20 lines
tmp]$ ./a 20020520 140517 tmp]$ date lun may 20 14:31:17 ART 2002 -- Alejandro Néstor Vargas ICQ: 20528995. Departamento de Desarrollo X Net Cuyo S.A. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Alejandro Néstor Vargas
to Alejandro Néstor Vargas: I just fund a problem in sysutils shipped with fpc version 1.0.6-beta [2002/04/30]. The…

Alejandro Néstor Vargas dijo:

Writeln(FormatDateTime('YYYYMMDD hhmmss',now));

I checked the source code. The problem existed also in previous versions. I checked the source code and i found there is a function called TimeReFormat that converts the 'm' in 'n'. I think it should be 'N' instead of 'n'.

Alejandro Néstor Vargas ICQ: 20528995. Departamento de Desarrollo X Net Cuyo S.A.

Reply by email