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 ? Link to comment https://forums.phpfreaks.com/topic/102147-function-to-get-the-next-date/ 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" Link to comment https://forums.phpfreaks.com/topic/102147-function-to-get-the-next-date/#findComment-522860 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 ?> Link to comment https://forums.phpfreaks.com/topic/102147-function-to-get-the-next-date/#findComment-522861 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 Link to comment https://forums.phpfreaks.com/topic/102147-function-to-get-the-next-date/#findComment-522896 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.