I am creating a WordPress plugin and can see that on some servers, for certain files, the stat
(or filemtime
) returning invalid mtime value. In some cases it is a negative value or a very large value (more than 3 billion).
In FTP I can see that the timestamp is correct though.
When you get Negative numbers in any PHP timestamp its just the amount of seconds before the Unix Epoch and this is not limited to filemtime
Example A
echo strtotime("1950-1-1"); // Outputs -631155600
^------- negative value
Example B
Outputting negative values does not mean you can not format it correctly if you try
echo date("Y-m-d",-631155600); // Output 1950-01-01
Lastly
FTP I can see that the timestamp is correct though
Your FTP application is definitely not PHP and has its own internal date system .. its Date System might not use negative values in timestamp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With