如何解析时间戳与人类可读性



我在网上查看了各种示例;但是,我似乎无法将LinkedIn时间戳正确地解析。

年度不合时宜。

我在这里缺少什么?

1352236307000

      function parseTwitterDate(epoch) {
                    var newDate = new Date();
                    newDate.setTime(epoch * 1000);
                    dateString = newDate.toUTCString();
                    return dateString;
                };

发布太阳,44820年8月30日04:23:20格林尼治标准时间

简单地将其作为日期构造函数的参数:

new Date(1352236307000).toLocaleString()

它以毫秒为单位。只需与1000分开。

最新更新