SetFileDate

SetFileDate["file"]

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

Details

  • 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.

Examples

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:

Check:

Set a specific date:

Delete the temporary file:

Scope  (1)

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

Wolfram Research (1991), SetFileDate, Wolfram Language function, https://reference.wolfram.com/language/ref/SetFileDate.html (updated 2016).

Text

Wolfram Research (1991), SetFileDate, Wolfram Language function, https://reference.wolfram.com/language/ref/SetFileDate.html (updated 2016).

CMS

Wolfram Language. 1991. "SetFileDate." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/SetFileDate.html.

APA

Wolfram Language. (1991). SetFileDate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SetFileDate.html

BibTeX

@misc{reference.wolfram_2024_setfiledate, author="Wolfram Research", title="{SetFileDate}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/SetFileDate.html}", note=[Accessed: 30-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_setfiledate, organization={Wolfram Research}, title={SetFileDate}, year={2016}, url={https://reference.wolfram.com/language/ref/SetFileDate.html}, note=[Accessed: 30-December-2024 ]}