Currently I'm trying to define an object for file dates. This object shall allow to compare time stamps for files on disk and in archives, and it also shall be usable to set time stamps for such files. Now I'm undecided what unique internal date/time representation to use in such an object.
For comparison the minimum resolution of the given time stamps should be taken into account, so that computations don't result in different time stamps for the same time. This restriction prohibits the use of TDateTime, where floating point calculations can result in such differences. Do there exist usable data formats for such time stamps? What time stamps are in use on the various platforms? What methods would you expect with such an object, so that the date/time information can be displayed and compared to other time stamps on the host OS? AFAIK Unix file time stamps are UTC in seconds since 1970. That format would be safe for comparisons, calculations only are required for display purposes (uncritical). DOS (FAT) file time stamps are in local time, without an indication of the time zone. Furthermore the date is a calendar date, so that calculations are required to convert such time stamps into UTC. How to accomplish a conversion into a unique UTC date, so that the stamps will compare equal regardless of local time zones or daylight savings? Win32 has another (NTFS) file time format, using UTC and elapsed time in 100 ns resolution. A translation from/into Unix time stamps should be safe and easy? DoDi _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel