I thought strtotime() would convert a “string” into a timestamp. If I add on to the time, it works fine, but if I try to subtract, it doesn’t. Does anyone know a workaround?
Thanks in advance.
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.
I recommend reading Derick Rethans’s excellent guide on Date and Time, http://derickrethans.nl/talks/time-zendcon9.pdf, explanatory slides start at slide 16.
He’s the author of PHP’s date and time functions and recommends that you use the DateTime classes if possible.