[fpc-devel] Add {$I %DATETIME%}
Jonas Maebe
jonas.maebe at elis.ugent.be
Sat Feb 27 13:08:58 CET 2016
On 27/02/16 11:12, Denis Kozlov wrote:
>
> What if we define %TIMESTAMP% or %UNIXTIMESTAMP%, instead of %DATETIME%?
>
> * %UNIXTIMESTAMP% - as a well defined Unix timestamp (i.e. number of
> seconds since Unix Epoch).
> * %TIMESTAMP% - as an Int64 version of TTimeStamp (i.e. number of MSecs
> since 1/1/0001).
>
> These could be inserted as plain old integers by the compiler, just like
> %LINENUM%, so there is no ambiguity nor implication of an agreement for
> encoding TDateTime as Double.
>
> Sample code is attached. It demonstrates how to get both of these
> timestamps in complier with only a single dependency on SysUtils unit.
>
> Any thoughts?
If something is platform-specific, it generally does not belong as a
language extension.
Jonas
More information about the fpc-devel
mailing list