$file->modified()
Get the file's last modification time.
$file->modified(IntlDateFormatter|string|null $format = null, string|null $handler = null, string|null $languageCode = null): string|int|false
Parameters
Name | Type | Default | Description |
---|---|---|---|
$format | IntlDateFormatter orstring ornull |
null
|
|
$handler | string ornull |
null
|
date, intl or strftime |
$languageCode | string ornull |
null
|
Return types
string
orint
orfalse
This method modifies the existing $file
object it is applied to and returns it again.
Parent class
Examples
if ($file = $page->file()) {
// unix timestamp
echo $file->modified();
// formatted date
echo $file->modified('d/m/Y');
// formatted date using strftime
echo $file->modified('%d/%m/%Y', 'strftime');
}
The modification time reflects the actual file as well as the .txt
content file(s), whichever was last modified.