[fpc-devel] Problem with Now() and time changed by ntpd

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Nov 3 21:11:37 CET 2011


Pete Cervasio schrieb:

>  > Splitting the TDateTime into year, month etc. is done by a DecodeDate...
> 
>  > function, that *assumes* that TDateTime contains a local time. When you
> 
>  > feed it an UTC time, the result is unusable.
> 
> What? How does it assume it's in local time? It assumes it has received 
> the value you want decoded. The value 40850.5 treated as a TDateTime is 
> 03 NOV 2011 @ 12:00.

How do you get the starting date and time of the epoch?

According to Delphi help a TDateTime of 0.0 represents 12/30/1899 12:00 
am, while Wikipedia states "start counting the seconds from the Unix 
epoch of 1970-01-01T00:00:00 UTC".

DoDi




More information about the fpc-devel mailing list