开发者

How to get datetime in words like "today", "yesterday" or "25 minutes ago"? [duplicate]

This question already has answers here: Closed 11 years 开发者_如何学编程ago.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜