I’m trying to convert given string in format 1899-12-30 19:00:00.000 to date using this function:
$startDate = strtotime("1899-12-30 19:00:00.000");
but as a result I get a wrong date, e.g.
30.10.2008 00:00:00
what am I doing wrong?
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.
Use
DateTime:Note that this will be a negative value since it’s before Jan 1st, 1970. The above code outputs:
Make sure you set the correct timezone in the constructor to
DateTimeZone(or you can omit it to leave it as default).