<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
<div class="moz-text-flowed" style="font-family: -moz-fixed;
font-size: 12px;" lang="x-western"> Hello listers,
<br>
<br>
A strange error came up when formating a date. See this code:
<br>
writeln(formatdatetime('dd/mm/YYYY', now));
<br>
The answer should be: 31/01/2012
<br>
The answer was: 31-01-2012
<br>
I did one test else:
<br>
writeln(formatdatetime('dd$mm$YYYY', now));
<br>
The answer was: 31$01$2012
<br>
Yes, the problem seems to be related to the backslash.
<br>
DefaultFormatSettings.DateSeparator := '/';
<br>
writeln(formatdatetime('dd/mm/YYYY', now));
<br>
The answer was: 31/01/2012
<br>
Right! That's the answer. But it was necessary to setup the
settings manually.
<br>
The test was done with Freepascal 2.4.4 and Ubuntu 10.10.
<br>
Does someone know what is my mistake?
<br>
Regards,
<br>
Luciano
<br>
</div>
</body>
</html>