How to get datetime in words like "today", "yesterday" or "25 minutes ago"? [duplicate]
Possible Duplicate:
How do I calculate relative time? How to display “12 minutes ago” etc in a PHP webpage?
I have date formats like this:
2011-09-10 12:00:00
2011-09-12 11:02:05
2011-09-12
I want to create a function that will get a date and will output something like this ?
5 minutes ago
2 hours ago
today
yesterday
and show date if date is far away.
Is there any related function in php or any free already written library.
Thanks
精彩评论