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. Quote Link to comment 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. Quote Link to comment 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.