开发者

Need help parsing date and time in javascript!

开发者 https://www.devze.com 2023-02-10 08:47 出处:网络
I\'m adding a facebook feed to a jquery mobile application i am working on.I am trying to parse the \"created_time\" that is in the JSON data.This is what is in the returned JSON: 2011-01-29T16:30:03+

I'm adding a facebook feed to a jquery mobile application i am working on. I am trying to parse the "created_time" that is in the JSON data. This is what is in the returned JSON: 2011-01-29T16:30:03+0000. I would really love to have the data returned and displayed the same way that facebook has it. That would mean that if the post was less than an hour ago it would display as ## minutes ago, if it was more than an hour ago b开发者_运维百科ut less than a day ago it would display as ## hours ago, otherwise it would display as February 2 at 6:54pm. I would love some help with this! Thanks a lot!


Try pretty date from the author of jQuery. Available standalone or as a jQuery plugin. By default it doesn't format dates older than a month, so you may want to edit this to ignore after X hours/days rather than months.

0

精彩评论

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

关注公众号