English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Filesystem Reference Manual
The filectime() function returns the last modified time of the specified file. This function can check the daily modification of the file and the modification of the inode. Inode modification can refer to the modification of permissions, ownership, group, or other metadata. If successful, the function will return the last modified time of the file as a Unix timestamp. If it fails, it will return false.
int filectime ( string $filename )
You can cache the result of this function and use clearstatcache() to clear the cache. We can use the filemtime() function to return the last modified time of the file content.
Use the filemtime() function to return the last modified time of the file content and format the time
<?php echo filectime("/PhpProject/sample.txt"); echo "\n"; echo "Last modification: ".date("Y-m-d H:i:s., filectime("/PhpProject/sample.txt")); ?>
Output result
1590217956 Last modification: 2020-05-23 09:12:36.