<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body>
<p>I wrote a program:</p>
<p>- windows 8 32 bits</p>
<p>- lazarus 1.2.4  ... fpc 2.6.4</p>
<p>then I copied it to another computer</p>
<p>- windows 7 64 bits</p>
<p>- lazarus 1.0.14 .... fpc 2.6.2</p>
<p>and got into trouble with dates format! programs behave diferent way, and what was working on the fisrt computer does not work properly in the second!</p>
<p>I guess I need some tutorial (I looked for but did not find anything :( !)</p>
<p>why formatDateTime( 'DD/MM/YYYY', now) returns 18-11-2014 and not 18/11/2014 ?</p>
<p> </p>
<p>strtodate( formatDateTime( 'DD/MM/YYYY', now)) works ok on the w 8 32 bits, but arise an exception on the w 7 64 bits.</p>
<p> </p>
<p>I am confused with the following syntax</p>
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<p><tt><span class="code"><span class="kw">function</span> FormatDateTime<span class="sym">(</span></span></tt></p>
</td>
</tr>
<tr>
<td>
<p><tt><span class="code">  <span class="kw">const </span>FormatStr<span class="sym">: </span>string<span class="sym">;</span></span></tt></p>
</td>
</tr>
<tr>
<td>
<p><tt><span class="code">  DateTime<span class="sym">: </span><a href="http://www.freepascal.org/docs-html/rtl/system/tdatetime.html">TDateTime</a><span class="sym">;</span></span></tt></p>
</td>
</tr>
<tr>
<td>
<p><tt><span class="code">  <span class="kw">const </span>FormatSettings<span class="sym">: </span><a href="http://www.freepascal.org/docs-html/rtl/sysutils/tformatsettings.html">TFormatSettings</a></span></tt></p>
</td>
</tr>
<tr>
<td>
<p><tt><span class="code"><span class="sym">):</span>string<span class="sym">;</span></span></tt></p>
</td>
</tr>
</tbody>
</table>
<p>how does it work between two format especifications: FormatStr and FormatSettings ?</p>
<p>appreciate any example of good programming pratise of data formating to avoid bad surprise moving program from an OS to another !</p>
<p>Philippe</p>
</body></html>