I am stuck with the problem of getting the difference of two datetimes (or they may be timestamps) to show how long ago the record was updated. Let's say my table has field `modified` which is datetime and means the date and time the record was last modified. I try to do it in a way like this:
Code:
select *, date_format(now() - modified, "%H:%M:%S") as mod from table
But this returns records with empty `mod` field. I feel taht there is a way to do it in a single query, without post-processing dates in php, but I cannot understand what am I doing wrong.
|