Zyphering Posted April 21, 2008 Share Posted April 21, 2008 Is there any function or trick in php or mysql to get the next date when you enter a date. Input = 2008-04-21 Return = 2008-04-22 Should work for all dates/years. like - Last day of the Month, Last Day of the Year, Leap Years ? Is there any direct function to this or would have have to code this calander totally ? Quote Link to comment Share on other sites More sharing options...
micah1701 Posted April 21, 2008 Share Posted April 21, 2008 $nextDate = date("Y-m-d",strtotime(+1 days, "2008-04-21")); /edit, "or something like that" Quote Link to comment Share on other sites More sharing options...
thebadbad Posted April 21, 2008 Share Posted April 21, 2008 <?php $input = '2008-04-21'; $output = date('Y-m-d', strtotime($input.' +1 day')); echo $output; //2008-04-22 ?> Quote Link to comment Share on other sites More sharing options...
Zyphering Posted April 21, 2008 Author Share Posted April 21, 2008 <?php $input = '2008-04-21'; $output = date('Y-m-d', strtotime($input.' +1 day')); echo $output; //2008-04-22 ?> Thanks man that worked 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.