[Lazarus] Alternative to getTime() of JavaScript
Michael Schnell
mschnell at lumino.de
Mon Sep 26 10:38:40 CEST 2011
On 09/24/2011 12:10 AM, silvioprog wrote:
> "... The getTime() method returns the number of milliseconds since
> midnight of January 1, 1970 and the specified date."
As the TDateTime type is a real incrementing in +1 for a day, it's easy:
var
BaseDate: TDateTime, MyDate;
MyMsecs: Int64
BaseDate = (do a decent specification of Jan 1, 1970, 0:0:0:0)
...
MyDate := Now - BaseDate;
MyMsec := MyDate * (24*60*60*1000);
-Michael
More information about the Lazarus
mailing list