[Lazarus] Alternative to getTime() of JavaScript

Sven Barth pascaldragon at googlemail.com
Sun Sep 25 20:03:48 CEST 2011


On 24.09.2011 00:10, silvioprog wrote:
> Hi,
>
> Is there any native function in FPC similar to getTime() of JavaScript?
>
> Thx.
>
> "... The getTime() method returns the number of milliseconds since
> midnight of January 1, 1970 and the specified date."
>

I personally suggest using "DateTimeToUnix" which is located in unit 
"dateutils". It converts a TDateTime to an Unix timestamp (which is the 
count of milliseconds since 1/1/1970). See also here: 
http://www.freepascal.org/docs-html/rtl/dateutils/datetimetounix.html

=== source begin ===

DateTimeToUnix(Now);

=== source end ===

Regards,
Sven




More information about the Lazarus mailing list