[fpc-pascal] FileAge and timezone

Jürgen Hestermann juergen.hestermann at gmx.de
Thu Oct 30 18:01:31 CET 2014


Am 2014-10-30 um 15:21 schrieb Michael Van Canneyt:
> On Thu, 30 Oct 2014, Mattias Gaertner wrote: Under Linux I see UTC.
>> But on Windows it seems to return with timezone. See this bug:
>> http://bugs.freepascal.org/view.php?id=26963
>
> Quite possible: like I said, it depends on the OS. The change to TDateTime should take care of that by converting it always to local time.
> If you want it always in UTC for internal reasons, then additional functions need to be developed:
> On linux that will be a No-op, on windows it will need to take care of some stuff...

On Windows it's UTC too.
The Windows API function "FindFirstFileW" gives
back a data structure where the dates are UTC times.
So to get local times you need to convert with "FileTimeToLocalFileTime".






More information about the fpc-pascal mailing list