[fpc-pascal] convert st_mtime from BaseUnix.FpStat to year, month, day, hour, minute, sec

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Nov 21 00:16:28 CET 2009

On 20 Nov 2009, at 23:49, Bruce Bauman wrote:

> I need to convert the st_time field of the record returned by BaseUnix.FpStat to the year, month, day, hour, minute and second and need to compensate for the local timezone.

The dateutils unit contains the following functions that you can use:

Function DateTimeToUnix(const AValue: TDateTime): Int64;
Function UnixToDateTime(const AValue: Int64): TDateTime;

Once you have a TDateTime, you can use DecodeDateTime() to extract the various components.

> I've read over the RTL documentation and am thoroughly confused. Some of the documentation of the interfaces say that they are unimplemented and will raise an exception. 

Which ones?

> Others just appear to be missing.

Which ones?


More information about the fpc-pascal mailing list