Jump to content

Calculating Time remaining from DateTime field


jbwebdesign

Recommended Posts

Hello, I have been trying to figure out How to calculate the amount of HOURS remaining between 2 datetime fields in MySQL.

 

Can someone please help me .....

 

I am trying to do something like this:

 

<?php 
$datetime1 = "2012-08-06 08:46:00"; //this is the later date
$datetime2 = "2012-08-05 08:45:00"; //this is the earlier date

//I want to return the difference between $datetime1 and $datetime2 in HOURS, MIN, and SECONDS remaining.


?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...