Possible Duplicate:
PHP: producing relative date/time from timestamps
please see the example of PHP code:
<?php
$now = date("Y-m-d H:i:s");
$comment_added = date("2012-05-25 22:10:00");
?>
As the output, I would like to get something like this (depending on when a comment has been added):
Comment has been added 21 minutes ago.
Comment has been added 15 hours ago.
Comment has been added 2 days ago.
Comment has been added 3 months ago.
Comment has been added 4 years ago.
I would like to get a function, where it will be selected automatically. Any examples would be appreciated.