[Lazarus] Alternative to getTime() of JavaScript

Zaher Dirkey parmaja at gmail.com
Sun Sep 25 01:29:38 CEST 2011


On Sat, Sep 24, 2011 at 2:30 AM, silvioprog <silvioprog at gmail.com> wrote:

> 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 *
> ===============================================
>


What about
Result := Trunc(Now * MSecsPerDay);

Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110925/9ed2cf5a/attachment-0003.html>


More information about the Lazarus mailing list