Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rules for "Date Modified" of folders in Windows Explorer

How does Windows Explorer determine the "Date Modified" field for folders? [Aside: I know this is asking from an explorer-specific perspective, but the behaviour could be useful to coding search/sort type activities]

Is there a definitive description of this anywhere - searches of Microsoft, MSDN, Google & Stack Overflow have been unsuccessful.

Personal experiments seem to suggest that in a tree of folders:

  1. when a folder/file is added/deleted in a folder, the containing folder's date modified is updated.
  2. when the content of a file is modified, the containing folder is unaffected

However, I'm looking at some directories that don't seem to conform to these basic rules - running down the tree I have (dates in DD/MM/YYYY format):

folder     (date created:  2/2/2006, date modified: 2/3/2006)   folder   (date created:  2/2/2006, date modified: 2/3/2006)     folder (date created:  2/2/2006, date modified: 1/6/2009)       file (date created: 27/3/2009, date modified: 2/2/2006) 
like image 622
Kevin Haines Avatar asked Jun 22 '09 01:06

Kevin Haines


People also ask

What does date modified mean on a folder in Windows?

The modified date of a file or folder represents the last time that file or folder was updated. If you're having trouble with the modified dates of your files or folders, check out these frequently-asked questions.

How do I get the date modified on a folder?

How to find the date of modified files. Press the Windows key + E on the keyboard to open File Explorer. On the left side-scrolling menu, select the drive or folder that you want to view the last modified date(s) (A) for the contents.

Can I prevent the folders modified date from changing when I select the folder?

The other way to prevent opening an Excel file from changing the folder's modified date is to ctrl-shift right click on file name and select open in protected mode.

How do I change the date modified in File Explorer?

You can manually change the Last Modified Date/Time for a file using a free software called Attribute Changer from http://www.petges.lu/. You will need to remember the modified date/time of your presentation file, modify the file and then use Attribute Changer to set the modified date/time to the previous one.


2 Answers

Disclaimer: I tested all of these myself on Windows 10. I could not find an authoritative source documenting all of these behaviours. It is entirely possible that I made a mistake somewhere.

The folder's last modified time is updated for these actions:

  • new file or folder directly in target folder
  • renamed file or folder directly in target folder
  • deleted file or folder directly in target folder
  • hardlink create/delete/rename - same as files
  • file/folder symlink create/delete/rename
  • directory junction create/delete/rename

It is not updated for these actions:

  • modified contents of file directly in target folder
  • edit target of symlink or junction contained in target folder
  • file's or sub-folder's created/modified date changing
  • edit basic attributes (hidden/archive/system) of a direct child
  • NTFS compression/encryption change of a direct child
  • anything at all happening in a sub-folder - literally anything
  • changing attributes of the folder itself
  • changing owner/ACL of the folder itself
  • owner or ACL of a direct child changing
  • if the folder is a directory junction, changing the target
  • adding/deleting alt data streams to a direct child file
like image 120
Roman Starkov Avatar answered Sep 30 '22 14:09

Roman Starkov


This is not explorer specific, this is NTFS-related.

See http://support.microsoft.com/kb/299648 https://web.archive.org/web/20080219020154/http://support.microsoft.com/kb/299648 for some rules.

Note: Modified time can be disabled with filesystem option, so you should never rely on it. Any suggested reliable methods would be appreciated.

like image 36
J-16 SDiZ Avatar answered Sep 30 '22 14:09

J-16 SDiZ