How Does Windows Decide Which of Two Files With Identical Time Stamps Is Newer?

how-does-windows-decide-which-of-two-files-with-identical-time-stamps-is-newer photo 1

What does it mean when you have two identical files with identical time stamps, yet Windows says that one file is newer than the other one? How can that be? Today’s SuperUser Q&A post helps a confused reader solve a time stamp mystery.

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

The Question

SuperUser reader WBT wants to know how Windows decides which of two files with identical time stamps is newer:

When Windows displays a dialog like this with matching time stamps, how does it determine which of the two files is newer?

how-does-windows-decide-which-of-two-files-with-identical-time-stamps-is-newer photo 2

At first, I thought Windows was comparing the date created attribute and using the result of that comparison to label one or the other as newer. If a file was copied into a particular location, it may have the creation date of when the copy was made rather than the creation date of the original file. However, after reproducing it with another file, the result of which one is newer seems to be the opposite:

how-does-windows-decide-which-of-two-files-with-identical-time-stamps-is-newer photo 3

The result is the same whether copying or moving the file:

how-does-windows-decide-which-of-two-files-with-identical-time-stamps-is-newer photo 4

And for background, the file in test2 is a previously made copy of the file in test1.

How does Windows decide which of two files with identical time stamps is newer?

The Answer

SuperUser contributor grawity has the answer for us:

Time stamps in the NTFS file system have a resolution of 100 nanoseconds (0.0000001 s). Even if the properties dialog shows the same rounded value, it could still be that the files were created within tenths of a second of each other.

Note: Most file systems measure times in μs or ns. FAT32 is a bit of a relic and rounds timestamps to two seconds.

Try one of the following methods to compare the full time stamps:

  • wmic datafile where name=”c:\\foo\\bar.txt” get lastmodified

Via PowerShell:

  • (Get-ChildItem c:\foo\bar.txt).LastWriteTime.ToString(“o”)

Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

Image Credit: WBT (SuperUser)

Article How Does Windows Decide Which of Two Files With Identical Time Stamps Is Newer? compiled by Original article here

Recommended stories

More stories

How to Set Up and Use Samsung Gear VR

So you’ve got your Samsung Galaxy device and the company’s accompanying virtual reality headset, Gear VR. That’s awesome! Gear VR provides a great, inexpensive taste of what virtual reality has to offer. Let’s show you how to get that thing all set up and running so you can strap it your face and