Jump to content

DATETIME difference


plznty

Recommended Posts

Basically I am using DATETIME to store the time in which a row was input.

Format - 2010-11-13 21:31:53

How would I get the current time of page load and compare it to the database row "2010-11-13 21:31:53" then output the difference.

 

Example

$sqlresult = 2010-11-13 21:31:53;

$currentTime = (GET CURRENT DATE+TIME = (2010-11-13 21:31:55) );

 

Output -

This was posted 2 minute's ago.

 

Thank you in advance. Any help would be greatly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/218598-datetime-difference/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.