Recent

Author Topic: Different date and time for files, Windows versus Lazarus  (Read 1117 times)

ASBzone

  • Sr. Member
  • ****
  • Posts: 461
  • Automation leads to relaxation...
    • Free BrainWaveCC Console Utilities
Re: Different date and time for files, Windows versus Lazarus
« Reply #15 on: July 28, 2020, 04:48:51 pm »
   My computer's Time zone is set to "(UTC-05:00) Eastern Time (US & Canada)." The switch for "Adjust for daylight saving time automatically" is set to "On." Both files were saved with those settings on the dates shown; i.e. I did not change the date manually and then save the files.

BTW, I have seen this behavior for many years across a number of applications, such as some Zip-compatible archiving apps.
-ASB: https://www.BrainWaveCC.com

Lazarus v2.0.11 r63516 / FPC v3.2.1-r46879 (via FpcUpDeluxe) -- Windows 64-bit install w/32-bit cross-compile
Primary System: Windows 10 Pro x64, Version 2004 (Build 19041.508)
Other Systems: Windows 10 Pro x64, Version 2004 or greater

MarkMLl

  • Hero Member
  • *****
  • Posts: 1219
Re: Different date and time for files, Windows versus Lazarus
« Reply #16 on: July 28, 2020, 10:17:13 pm »
It all depends on rounding. The date on a NTFS has a higher precision than 1 second. So if the time is 01:01:00.123 then Windows might display it as 01:01:00 while the mechanism of FPC to calculate the 2-second precision time might be 01:01:02. Don't be bothered too much by that 2 second difference.

The direction of rounding is critically important when one's using make... and my recollection is that MS was just one of many development teams to do so in the mid 80s when the DOS/Windows/C APIs were maturing.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

 

TinyPortal © 2005-2018