playaz Posted July 25, 2006 Share Posted July 25, 2006 Hi guys,I have a serious of forms on a site, basically when the form is created it puts the time in a field called 'created_date' in the DB (MySQL) similarly once the process is completed it puts the time in a field called 'completed_date'.How can I calculate the time difference between the two columns within the row in the db?e.g.created-date - 2006-07-22 13:15:39completed_date - 2006-07-25 14:24:35How do I work out the difference between the two?Thanks in advance :) Quote Link to comment https://forums.phpfreaks.com/topic/15583-date-calculation-on-two-variables/ Share on other sites More sharing options...
hussain Posted July 25, 2006 Share Posted July 25, 2006 hi am hussaintry this $elapsed=strtotime($entertime)-strtotime($completetime); $totalelapsed= gmdate("H:i:s",$elapsed); Quote Link to comment https://forums.phpfreaks.com/topic/15583-date-calculation-on-two-variables/#findComment-63375 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.