从RSS馈送到“”的日期格式化程序;时间.ago”;

Date formatter from RSS feed to "time.ago"

本文关键字:程序 格式化 RSS 时间 ago 日期      更新时间:2023-09-26

我正在尝试创建RSS提要网页和RSS答案,其日期格式为"Thu, 15 Aug 2013 12:42:05 -0700" wat,我想将其更改为例如"12 minutes ago"。我试过了http://timeago.yarp.com/但它并不适用于这种格式。我想用javascript实现这一点。有什么建议吗?

查看moment.js,用法:

moment("Thu, 15 Aug 2013 12:42:05 -0700").fromNow() // 8 hours ago