Wiki source for FileModificationTime


Show raw source

=====File Modification Time Action=====

This action allows you to display the modification time of any file on the filesystem. Save this as ##actions/filemtime.php##:

%%(php) <?php
/*
filemtime action
Displays the modification time of a file
Syntax: {{filemtime path="/path/to/file"}}
*/

$path = trim($vars['path']);

if (file_exists($path)) {
echo "<font size=-2>" . date("M d, Y h:i:s a", filemtime($path)) . "</font>";
} else {
echo "<!-- ERROR (filemtime): '" . htmlspecialchars($path) ."' not found -->";
}

?>%%

If you find this action useful, post a comment and let me know! Also, feel free to comment with requests for feature enhancements. --JasonHuebel

----
CategoryUserContributions
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki