Reference

Guide

$file->modified()

Get the file's last modification time.

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

Parameters

Name Type Default Description
$format string null
$handler string null

date or strftime

Return type

mixed

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');

}

Source code

kirby/src/Cms/File.php#L376