On 1/31/2012 22:23, Luciano de Souza wrote:
Hello listers,
A strange error came up when formating a date. See this code:
writeln(formatdatetime('dd/mm/YYYY', now));
The answer should be: 31/01/2012
The answer was: 31-01-2012
I did one test else:
writeln(formatdatetime('dd$mm$YYYY', now));
The answer was: 31$01$2012
Yes, the problem seems to be related to the backslash.
errrm1... that's not a 'back slash'... that's a "forward" slash.. aka just a
plain slash... "back slash" leans backwards (ie: top to the left)...
DefaultFormatSettings.DateSeparator := '/';
writeln(formatdatetime('dd/mm/YYYY', now));
The answer was: 31/01/2012
Right! That's the answer. But it was necessary to setup the settings manually.
The test was done with Freepascal 2.4.4
errrm2: FP 2.6.0 is the current release... unless i'm highly mistaken... but
still, see higher above ;)
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal