0

Hi,

I have a problem with strtotime displaying months. See the code:

print(date('M-d')); //prints May-31
print(date('M-d',strtotime('-1 month'))); //prints May-01

Since i need it to get the previous month, why is the function ignoring the fact that there are 31 days in May?

Thanks

2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by cereal
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.