Skip to content

Kirby 4.5.0

$file->modified()

Get the file's last modification time.

$file->modified(IntlDateFormatter|string|null $format = null, ?string $handler = null, ?string $languageCode = null): string|int|false

Parameters

Name Type Default Description
$format IntlDateFormatter|string|null null
$handler string|null null date, intl or strftime
$languageCode string|null null

Return type

string|int|false

Parent class

Kirby\Cms\File

Example

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.