jas4 Posted May 9, 2007 Share Posted May 9, 2007 hi i've got 2 date values, both in the format yyyy-mm-dd, has anyone any ideas how to perform a calculation, so that I can take one date away from the other and be left with the days/difference between thanks Quote Link to comment https://forums.phpfreaks.com/topic/50681-calculations-with-date/ Share on other sites More sharing options...
Lumio Posted May 9, 2007 Share Posted May 9, 2007 <?php $date1 = "2006-05-24"; $date2 = "2007-05-24"; $different = strtotime($date2)-strtotime($date1); echo $different.'secs'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/50681-calculations-with-date/#findComment-249146 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.