Why does Explorer ignore seconds when sorting by Date Modified?

Raymond Chen

A customer reported that Explorer appears to be ignoring the seconds when sorting by Date Modified. The customer was kind enough to include detailed steps to reproduce the problem.

Start with a folder with several files, sorted by Date Modified.

Name Date modified Type
TPS 06-05-2012 Report 6/12/2012 7:00 AM Contoso Document
TPS 05-29-2012 Report 6/5/2012 11:30 AM Contoso Document
TPS 05-22-2012 Report 5/29/2012 10:17 AM Contoso Document
TPS 05-15-2012 Report 5/22/2012 2:35 PM Contoso Document
TPS 05-09-2012 Report 5/15/2012 11:26 AM Contoso Document
TPS 05-02-2012 Report 5/9/2012 10:31 AM Contoso Document

Right-click on the newest file, select Copy.

Right-click on the blank column on the right, select Paste. This will create a file with the same name, but with “- Copy” appended.

Press F5 to refresh the view and note the sort order. The copy appears at the top of the list.

Name Date modified Type
TPS 06-05-2012 Report – Copy 6/12/2012 7:00 AM Contoso Document
TPS 06-05-2012 Report 6/12/2012 7:00 AM Contoso Document
TPS 05-29-2012 Report 6/5/2012 11:30 AM Contoso Document
TPS 05-22-2012 Report 5/29/2012 10:17 AM Contoso Document
TPS 05-15-2012 Report 5/22/2012 2:35 PM Contoso Document
TPS 05-09-2012 Report 5/15/2012 11:26 AM Contoso Document
TPS 05-02-2012 Report 5/9/2012 10:31 AM Contoso Document

Highlight the newly-created file, hit F2, and give the document a different name, and also remove the “- Copy” suffix. Hit Enter to accept the operation.

Press F5 to refresh the view again. Notice that the file that you just renamed, which is the newest file in the folder (it having just been created seconds ago) appears second in the list.

Name Date modified Type
TPS 06-05-2012 Report 6/12/2012 7:00 AM Contoso Document
TPS 06-12-2012 Report 6/12/2012 7:00 AM Contoso Document
TPS 05-29-2012 Report 6/5/2012 11:30 AM Contoso Document
TPS 05-22-2012 Report 5/29/2012 10:17 AM Contoso Document
TPS 05-15-2012 Report 5/22/2012 2:35 PM Contoso Document
TPS 05-09-2012 Report 5/15/2012 11:26 AM Contoso Document
TPS 05-02-2012 Report 5/9/2012 10:31 AM Contoso Document

It appears that Explorer is ignoring the seconds in the Date Modified column and sorting only by the hour and minute.

It’s an interesting theory the customer came up with, but the customer was fooled by the fact that he ran the experiment shortly after modifying the TPS 06-05-2012 Report document, so that the real behavior was masked. When you copy a file, the system preserves the date-modified timestamp. The Date modified column is not ignoring the seconds; in fact, it’s comparing them quite carefully, but since the timestamps of the original and the copy are the same, the timestamps compare equal. And when the items compare equal according to the sort criteria, Explorer falls back to sorting by name, and the fallback sort is always ascending. The confusion would have been cleared up if the Date modified column used the long time format instead of the short time format, but that only pushes the problem to files whose timestamps are fractional seconds apart. You have two files which show up as “6/12/2012 7:00:12 AM” and don’t realize that one of them is “6/12/2012 7:00:12.02 AM” and the other is “6/12/2012 7:00:12.89 AM”. My guess is that geeks won’t be satisfied until Explorer shows the full 64-bit FILETIME so you can see the difference down to the 100-nanosecond interval.

(If you want to see the seconds, you can look on the file’s property sheet.)

0 comments

Discussion is closed.

Feedback usabilla icon