Skip to content

Kirby 3.7.5

$file->modified()

Get the file's last modification time.

$file->modified(string|\IntlDateFormatter|null $format = null, string $handler = null, string $languageCode = null): mixed

Parameters

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

Return type

mixed

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.