[Lazarus] Alternative to getTime() of JavaScript

silvioprog silvioprog at gmail.com
Sat Sep 24 01:30:08 CEST 2011


Or...

2011/9/23 silvioprog <silvioprog at gmail.com>:
[]
- var
-   Since19700101: TDateTime;
+ const
+   CSince19700101 =
+     ((1970 { Year } - 1900) * 365.25) + ((1 { Month } - 1) * 30) + 1 { Day };

-   Result := MilliSecondsBetween(Since19700101, Now);
+  Result := MilliSecondsBetween(CSince19700101, Now);

- initialization
-   Since19700101 := EncodeDate(1970, 1, 1);

-- 
Silvio Clécio
===============================================
Blog - <silvioprog.com.br>
Twitter - <twitter.com/silvioprog>
Facebook - <facebook.com/silvioprog>
LazSolutions - <code.google.com/p/lazsolutions>
LazWebSolutions - <code.google.com/p/lazwebsolutions>
Lazarus-BR - <groups.google.com.br/group/lazarus-br?hl=pt-BR>
===============================================
   * Conheça nosso canal IRC sobre Lazarus: #lazarus-br *
===============================================




More information about the Lazarus mailing list