If successful, the time is returned in Unix timestamp format. If it fails, false is returned.
Filemtime (string filename)
Returns the time when the file was last modified. If an error occurs, FALSE is returned. Time is returned in Unix timestamp format and can be used for date ().
The code is as follows: |
Copy code |
$ A = filemtime ("log.txt "); Echo "Modification time:". date ("Y-m-d H: I: s", $ ); |
Filectime (string filename)
Returns the time when the last inode of the file was modified. If an error occurs, FALSE is returned. Time is returned in Unix timestamp format.
The code is as follows: |
Copy code |
$ A = filectime ("log.txt "); Echo "creation time:". date ("Y-m-d H: I: s", $ ); |
Fileatime (string filename)
Returns the time when the object was last accessed. If an error occurs, FALSE is returned. Time is returned in Unix timestamp format.
The code is as follows: |
Copy code |
$ A = fileatime ("log.txt "); Echo "Modification time:". date ("Y-m-d H: I: s", $ )." |