roeyhaim Posted November 18, 2010 Share Posted November 18, 2010 Hello all, The exact thing that i need is to calculate how much days there is in between two dates. The only problem is that every thing that i found dont care about leap year Anyone have a function to do that? Quote Link to comment https://forums.phpfreaks.com/topic/219122-calculate-days-between-two-dates/ Share on other sites More sharing options...
roeyhaim Posted November 18, 2010 Author Share Posted November 18, 2010 Sorry about the spam but i found the function Can any one tell me how to edit it, that i can insert in format dd/mm/yyyy ??? function dateDiff($start, $end) { $start_ts = strtotime($start); $end_ts = strtotime($end); $diff = $end_ts - $start_ts; return round($diff / 86400); } Quote Link to comment https://forums.phpfreaks.com/topic/219122-calculate-days-between-two-dates/#findComment-1136326 Share on other sites More sharing options...
doni49 Posted November 19, 2010 Share Posted November 19, 2010 What do you mean "insert"? Into a database or for outputting in the browser? Quote Link to comment https://forums.phpfreaks.com/topic/219122-calculate-days-between-two-dates/#findComment-1136446 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.