Im trying to convert with strtotime dd/mm/aaaa 0:00:00 format date to timestamp.
Im using:
$a = "27/01/1981 0:00:00";
$b = str_replace("/","-",$a);
echo strtotime($b);
But not sure if is the best way Anyone help?
Thx
Im trying to convert with strtotime dd/mm/aaaa 0:00:00 format date to timestamp.
Im using:
$a = "27/01/1981 0:00:00";
$b = str_replace("/","-",$a);
echo strtotime($b);
But not sure if is the best way Anyone help?
Thx
php -r "var_dump(date('Y-m-d H:i:s', strtotime('01/02/2016 0:00:00')));" string(19) "2016-01-02 00:00:00"
Just make strtotime($var);