siwelis Posted March 21, 2010 Share Posted March 21, 2010 I've been trying to figure out the most efficient way to find out how much time is between point A entered using now() and point B also using now() but of course, at a different time. I'm also wondering if this can be done (and if it is better done) with mysql, but I know that's for a different forum, so I'll ask this question there too. So, how do I efficiently figure out the distance between two points in time? Thank you in advance. Quote Link to comment Share on other sites More sharing options...
teamatomic Posted March 21, 2010 Share Posted March 21, 2010 $now = mktime (0,0,0,date("m"), date("d"), date("Y")); $nextweek = mktime (0,0,0,date("m"), date("d")+7, date("Y")); $td= $nextweek-$now; $days_diff=$td/(60*60*24); HTH Teamatomic Quote Link to comment 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.