sets the modification and access dates for a file to be the current date.


  • SetFileDate["file",date] sets the modification and access dates to be the specified date.
  • The date can be given as a date object or in the date list format as obtained from DateList.
  • SetFileDate["file",date,"type"] sets if possible the specified type of date for a file. Types of dates include "Access", "Creation", and "Modification". All represents all types of dates.
  • SetFileDate[File["file"]] is also supported.


open allclose all

Basic Examples  (1)

Copy a file:

The date and time at which a file was last modified:

SetFileDate modifies the date of the file to be the current date:


Set a specific date:

Delete the temporary file:

Scope  (1)

Set the modification date of the file specified by the File object:

Introduced in 1991
Updated in 2008