Version: v0.8.1 - Beta.  We welcome contributors & feedback.

File.setDate

$path.setDate($date=now, $dateKey='both') -> self

Description

Update the modified and accessed date of a file or directory.

The $date must be a Date object.

file'files:/data.txt'.setDate()  // now

$newDate = Date.create('5 minutes ago')
file'files:/data.txt'.setDate($newDate)

Date Keys

Date Key Description
modified Date last written to.
accessed Date last opened for reading or writing.
both Both modified and accessed. (default)
file'files:/data.txt'.setDate(Date.now(), 'accessed')

See Also