When i am converting date from d-m-Y in Y-m-d format. i am facing some issues for it.
example 19/08/1989 will convert into 1989/08/19 (it's correct),
19/08/2059 will convert into 1970/01/01 (it's not correct)
$re_date = date('Y-m-d', strtotime($_POST['re_date']));
Help me please. thanks in advance.
The maximum date allowed is Tue, 19 Jan 2038 03:14:07 UTC on 32 bit system
From the strotime docs:
Note:
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.
If you want it to work for 32 bit system then try like this using DateTime
:
$date = new DateTime($_POST['re_date']);
echo $date->format('Y-m-d');