Dates showing up wrong on 31st of the month. |
There was a thing in php where strtotime gives the wrong answer at the end or beginning of months for +1 month and -1 month etc. It was, if I remember correctly, something like on April 30th the first day of the previous month was given as Feb 1, not April 1, because the + or - month functionality had a flaw of some sort in it.
However, I can't remember the exact details as I thought it was fixed in php 5.3+ but your problem really reminds me of that issue. The datetime class is much better, easier and more powerful now anyway. So I would suggest not using strtotime but the datetime class http://php.net/manual/en/class.datetime.php to work out your required months. Can you show how you are calculating -1 months in php? Might be more revealing. |
Messages In This Thread |
Dates showing up wrong on 31st of the month. - by doomie22 - 05-31-2017, 03:51 AM
RE: Dates showing up wrong on 31st of the month. - by php_rocs - 05-31-2017, 08:18 PM
RE: Dates showing up wrong on 31st of the month. - by PaulD - 06-01-2017, 10:34 AM
RE: Dates showing up wrong on 31st of the month. - by doomie22 - 06-01-2017, 01:08 PM
RE: Dates showing up wrong on 31st of the month. - by PaulD - 06-01-2017, 03:47 PM
|