Skip to content

Kirby 3.5.7.1

$file->modified()

Get the file's last modification time.

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

Parameters

Name Type Default Description
$format string null
$handler string null date 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.