Julian Posted April 18, 2008 Share Posted April 18, 2008 Hi guys I have this code: $last_day = date('Y/m/d',strtotime('-1 second',strtotime('+1 month',strtotime(date('m').'/01/'.date('Y').' 00:00:00')))); With it I can get the last day of the current month. Does anybody knows the code to get the next month last day? Regards Link to comment https://forums.phpfreaks.com/topic/101746-last-day-of-the-next-motnh/ Share on other sites More sharing options...
AndyB Posted April 18, 2008 Share Posted April 18, 2008 $last_day = date('Y/m/d',strtotime('-1 second',strtotime('+2 month',strtotime(date('m').'/01/'.date('Y').' 00:00:00')))); Link to comment https://forums.phpfreaks.com/topic/101746-last-day-of-the-next-motnh/#findComment-520589 Share on other sites More sharing options...
Barand Posted April 18, 2008 Share Posted April 18, 2008 simpler <?php echo date('M t', strtotime('next month')); ?> Link to comment https://forums.phpfreaks.com/topic/101746-last-day-of-the-next-motnh/#findComment-520609 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.