Hello
I have a database table where each record has a timestamp (created using the NOW() function perhaps CURRENT_TIMESTAMP is more correct to use?)
I wish to make a simple query which compare timestamp of right now with the timestamp in the database and returns the difference in seconds.
Is there some easy way to do this?
Darla
Fetch difference between two timestamps in seconds
Moderator: General Moderators
Code: Select all
select (UNIX_TIMESTAMP(NOW())-myTimestamp) as difference from myTable