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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.