hungryOrb Posted October 9, 2007 Share Posted October 9, 2007 I've posted about this before, but with the help offered, I couldn't get very far, probably because i'm a weak PHPer! I think what would benefit me most is if someone would provide the code that calculates the total number of minutes between these two dates: 25/12/2007 09:29:01 26/12/2007 10:15:20 Thank you Quote Link to comment https://forums.phpfreaks.com/topic/72434-solved-strtotime-help/ Share on other sites More sharing options...
Lumio Posted October 9, 2007 Share Posted October 9, 2007 <?php $date1 = strtotime('25/12/2007 09:29:01'); $date2 = strtotime('26/12/2007 10:15:20'); echo 'The difference is '.($date2-$date1).' seconds.'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/72434-solved-strtotime-help/#findComment-365268 Share on other sites More sharing options...
hungryOrb Posted October 9, 2007 Author Share Posted October 9, 2007 Ahh, nice ;] So simple too btw, are there optional parameters which filters the result into minutes, /60 or? Need to put the result into an easily readable total time. I realise I could just resort to using mass variables with each an assigned calculated seconds/minutes/hours/days, but I've a hunch there is an easier way Is? There? !! Quote Link to comment https://forums.phpfreaks.com/topic/72434-solved-strtotime-help/#findComment-365273 Share on other sites More sharing options...
Lumio Posted October 9, 2007 Share Posted October 9, 2007 Yes. To calculate minutes and hours and so on just use / Quote Link to comment https://forums.phpfreaks.com/topic/72434-solved-strtotime-help/#findComment-365274 Share on other sites More sharing options...
hungryOrb Posted October 9, 2007 Author Share Posted October 9, 2007 :/ Oki thanks Lumio ;] Does this site have rep? Can't find ._. Quote Link to comment https://forums.phpfreaks.com/topic/72434-solved-strtotime-help/#findComment-365277 Share on other sites More sharing options...
Aureole Posted October 9, 2007 Share Posted October 9, 2007 No it doesn't. Don't forget to click "topic solved" though... Quote Link to comment https://forums.phpfreaks.com/topic/72434-solved-strtotime-help/#findComment-365278 Share on other sites More sharing options...
hungryOrb Posted October 9, 2007 Author Share Posted October 9, 2007 Thanks guys :] MUCh appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/72434-solved-strtotime-help/#findComment-365283 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.