[fpc-devel]How to get the milliseconds since January 1, 1900

Olle Raab olle.r at automagika.se
Mon Sep 6 10:15:32 CEST 2004


04-09-02 20.15, skrev Zhong Wang följande:

> Hello, everybody
> 
> In Java and Java script, a date time can be
> converted to the milliseconds since January 1, 1900,
> and a long integer can be get. Is there a convenient
> function in FPC to be compatible with Java and
> Javascript? I think it's not so easy to convert
> TDateTime or TTimeStamp to the milliseconds since
> January 1, 1900 in FPC sysutils library.
> 

Afaik TDateTime is number of days since a certain start year (dont know
when). This should be easy to convert to nr of millisecond (guess you need
64 bit int for this). Since TDateTime is Double, it has decimals which
describes the fraction of the day.

Olle





More information about the fpc-devel mailing list