Possible Duplicate:
PHP: Is there a function that converts a date string in a human readable format?
I have a mysql table with a structure as follows:
table: persons column1: name varchar(60) column2: score int(11) column3: time datetime(60)
I have a form which inserts data into this table: name, score and the current timestamp(NOW()), using php. All the data is displayed with respect to the 'time' column in descending order.
My dilemma is how do I compare the time in the 'time column' with current time and display in human readable format like "5 minutes ago" or "2 hours ago" using php. Is there any function to find time difference in php directly? or should i be using javascript?