SetFileDate

SetFileDate["file"]
sets the modification and access dates for a file to be the current date.

DetailsDetails

  • SetFileDate["file", date] sets the modification and access dates to be the specified date.
  • The date must be given in the format used by DateList.
  • SetFileDate["file", date, "type"] sets if possible the specified type of date for a file. Types of dates include , , and . All represents all types of dates.

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

Copy a file:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

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

In[3]:=
Click for copyable input
Out[3]=

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

In[4]:=
Click for copyable input

Check:

In[5]:=
Click for copyable input
Out[5]=

Set a specific date:

In[6]:=
Click for copyable input
In[7]:=
Click for copyable input
Out[7]=

Delete the temporary file:

In[8]:=
Click for copyable input
New in 2 | Last modified in 7
New to Mathematica? Find your learning path »
Have a question? Ask support »