1 Feb 04:23
FormatDatetime is not respecting the specified pattern
Luciano de Souza <luchyanus@...>
FormatDatetime is not respecting the specified pattern
2012-02-01 03:23:55 GMT
FormatDatetime is not respecting the specified pattern
2012-02-01 03:23:55 GMT
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.
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 and Ubuntu 10.10.
Does someone know what is my mistake?
Regards,
Luciano
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.
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 and Ubuntu 10.10.
Does someone know what is my mistake?
Regards,
Luciano
_______________________________________________ fpc-pascal maillist - fpc-pascal@... http://lists.freepascal.org/mailman/listinfo/fpc-pascal


RSS Feed