<div dir="ltr"><div>Just add something like this to your compile process:</div><div><br></div><div> echo \'`date`\' > fpc_timestamp.inc</div><div><br></div><div>Then:</div><div><br></div><div><span style="font-size:12.8px">begin</span><br style="font-size:12.8px"><span style="font-size:12.8px"> WriteLn({$i fpc_timestamp});</span><br style="font-size:12.8px"><span style="font-size:12.8px">end.</span><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 23, 2016 at 5:57 AM, Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
I don't think this is a good idea.<br>
<br>
1. The TDateTime format is not a basic format of the language.<br>
It is an agreement on how to encode date/time information in a double.<br>
<br>
You now make the compiler dependent on this "agreement", promoting<br>
TDateTime to a compiler-recognized type.<br>
<br>
2. Some targets do not even have floats. That will cause problems as well.<br>
<br>
<br>
Michael.<div><div class="h5"><br>
<br>
<br>
<br>
On Tue, 23 Feb 2016, Denis Kozlov wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Can someone apply the patch for adding %DATETIME%, if there are no<br>
objections?<br>
<br>
Denis<br>
<br>
<br>
On 15 January 2016 at 21:23, Denis Kozlov wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm proposing addition of {$I %DATETIME%} directive. A trivial patch is<br>
attached.<br>
<br>
The following will be possible:<br>
const<br>
T = {$I %DATETIME%};<br>
begin<br>
WriteLn(DateTimeToStr(T));<br>
end.<br>
<br>
Benefits of this directive:<br>
1) Access to build date/time in native TDateTime format. Existing {$I<br>
%DATE%} and {$I %TIME%} are inserted as strings in predefined format,<br>
parsing is required to extract date/time components or to reformat it.<br>
2) Atomic access to build date/time. Use of {$I %DATE%} and {$I %TIME%}<br>
can have undesired effect if {$I %DATE%} is executed at 2016-01-15<br>
23:59:59.999 and 1 ms later {$I %TIME%} is executed at 2016-01-16<br>
00:00:00.000. Resulting combination of two directive is 2016-01-15<br>
00:00:00, a day out of date.<br>
3) Search and replace of build date/time is no longer a trivial text<br>
editor operation.<br>
<br>
The following ticket can then be resolved:<br>
<a href="http://bugs.freepascal.org/view.php?id=26472" rel="noreferrer" target="_blank">http://bugs.freepascal.org/view.php?id=26472</a><br>
<br>
</blockquote>
<br>
</blockquote></div></div>
_______________________________________________<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org" target="_blank">fpc-devel@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" rel="noreferrer" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a><br>
</blockquote></div><br></div>