The following code outputs 1970-01-01 which is wrong.
<?php
$dob='17 Jan 1900';
$datetime = strtotime($dob);
$dob = date("Y-m-d", $datetime);
echo $dob;
?>
However it works fine with $dob = '17 Jan 2000';
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your PHP version allow it consider Using DateTime instead of strtotime :
For PHP version between >= 5.2 and <= 5.3 simply use the DateTime constructor :