dannybrazil Posted March 27, 2011 Share Posted March 27, 2011 Hello, I have a code that adds 1 month to a specific date every month. $newdate = strtotime ( '+1 month' , strtotime ( $b_date ) ) ; $new_date = date ( 'Y-m-d' , $newdate ); the thing is some month of the year do not contain the SAME amount of days. For example: If the date was 2011-01-31 + 1 month = 03-03-2011 Is there any way to add a month (+1 month) but make it consider the calendar. lets say that I had 2011-01-31 --> +1 month == 2011-28-02 (the last day of the next month if there is NO similar days in month Thanks Link to comment https://forums.phpfreaks.com/topic/231852-date-manipulation/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.