我如何修复1800年的strotime

I have a little trouble with strtotime, I have a date 18 july 1868 and when I record in the database, I make $date = strtotime (18-07-1868). But when I appear it, I dated ('Y-m-d', $date) but it does not show me 18-07-1868 but 13-12-1901.

How can I fix this problem?

Thx,

From the manual:

The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 UTC to Tue, 19 Jan 2038 03:14:07 UTC.

(These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer.)

Additionally, not all platforms support negative timestamps, therefore your date range may be limited to no earlier than the Unix epoch. This means that e.g. dates prior to Jan 1, 1970 will not work on Windows, some Linux distributions, and a few other operating systems. PHP 5.1.0 and newer versions overcome this limitation though.

So it depends on the platform you're running it on. It needs to be 64 bit to exceed the range stated in the manual.

You are not putting a string (single quote or double quote) in strtotime() function...

Try This...

$x = strtotime('18-07-1868');
echo date('Y-m-d', $x);