plznty Posted November 13, 2010 Share Posted November 13, 2010 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 More sharing options...
Pikachu2000 Posted November 13, 2010 Share Posted November 13, 2010 You can get the difference right in the query string with the MySQL TIMEDIFF() function. Link to comment https://forums.phpfreaks.com/topic/218598-datetime-difference/#findComment-1133905 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.