$file->modified()
Get the file's last modification time.
$file->modified(IntlDateFormatter|string|null $format = null, 'date'|'intl'|'strftime'|null $handler = null, string|null $languageCode = null): int|string|false
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| $format | IntlDateFormatterorstringornull |
null
|
|
| $handler | 'date'or'intl'or'strftime'ornull |
null
|
Date handler, null for the configured one |
| $languageCode | stringornull |
null
|
Return types
intorstringorfalse
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.