Answer the question
In order to leave comments, you need to log in
Strange behavior of strtotime in php, can it be accepted or fixed?
Good afternoon, I'm trying to get the same date in php, a month ago. the following code gives a rather strange result
$d = strtotime("2018-03-31 -1 month");
echo gmdate("Y-m-d", $d); // result: 2018-03-03
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question