开发者

Display datetime like 1 hour ago, 5 hours ago, 3 days ago, [duplicate]

This question already has answers here: Closed 11 years ago. 开发者_运维问答

Possible Duplicate:

How do you do relative time in Rails?

I want to display the datetime like this:

30 seconds ago
1 hour ago
9 hours ago
2 days ago
1 year ago
..

Is this built in or should I write my own function to do this?


http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#method-i-distance_of_time_in_words

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜