Is it correct to obtain the file creation and modification time in PHP?

Why does the time obtained on mac do not match the actual situation? The problem now is that filemtime is the same as filectime

echo date("Y-m-d H:i:s", filemtime($file));
echo date("Y-m-d H:i:s", filectime($file));
echo date("Y-m-d H:i:s", fileatime($file));

the information I found is that unix has no file creation time, only inode modification time. So in this case, there is no way to know when the file was created?

https://stackoverflow.com/que.

Use filectime. For Windows it will return the creation time, and for Unix the change time which is the best you can get because on Unix there is no creation time (in most filesystems).

Note also that in some Unix texts the ctime of a file is referred to as being the creation time of the file. This is wrong. There is no creation time for Unix files in most Unix filesystems.

record a piece of reference material provided downstairs

http://php.net/manual/zh/func.
If you need file creation time on Mac OS X:

<?php
if ($handle = popen("stat -f %B " . escapeshellarg($filename), "r")) {
    $btime = trim(fread($handle, 100));
    echo strftime("btime: %Y.%m.%d %H:%M:%S\n", $btime);
    pclose($handle);
}


Php
Mar.28,2021

you need to make sure that the time of the local server is accurate, so that it is normal for


filemtime to get the last modification time. It's just that one is a 24-hour system and the other is a 12-hour system.
filectime gets the inode modification time
the last access time of the file obtained by fileatime

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e3b89f-42bf2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e3b89f-42bf2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?