Weird anomaly where Modified time is sometimes rounded up

  • File’s Modified time is sometimes rounded up if seconds is 58 or 59.

    This is a weird anomaly that occurs with PA, WinZip, DOpus ZIP (and probably other archive apps). When creating a ZIP archive the Modified time of some files is rounded up when the seconds component is 58 or 59. eg. If the file being Zipped up has a Modified time of 05.54.58, then the same file in the Zip archive will have a Modified time of 05.55.

    If I manually set the Modified time to exactly the same time of 05.54.58 and then Zip the file up, the same file in the Zip archive will now have a Modified time of 05.54.

    I have no clue as to what’s going on. Any ideas ?

    I’ve attached a sample file which illustrates this problem.

    EDIT: Sorry, I tried to attach the file but the process of downloading it affects the modified time, and so the problem no longer exists.

    BTW, I noticed this problem because sometimes after Zipping up a folder, I will Compare the contents of the original folder with the contents of the Zip archive, getting it to flag any files whose modified date is different.

  • conexware

    Very interesting.

    I have done some quick testing and readup (google is the king). Apperantly Win32 filetime is set at 100 interval of nano second since Jan 1, 1601, while zip format standard specs say that it is using “MS DOS format” (I think milliseconds is the lowest MS dos file format goes). This means that there is some rounding up to at the end, and notice that once you extract the file once you compress it again there wont be any more of rounding up anymore.

    Very interesting thought there, i really did not know this before…

  • i come across this problem, however its not just msdos thats the problrm but a computers internal clock can also cause problems

Log in to reply