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. Link to comment https://forums.phpfreaks.com/topic/196035-find-time-between-now-last-week-and-now/ 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 Link to comment https://forums.phpfreaks.com/topic/196035-find-time-between-now-last-week-and-now/#findComment-1029721 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.