如何将GMT时间戳转换为Unix时间戳(javascript) [英] How to convert a GMT timestamp to Unix timestamp (javascript)

查看:424
本文介绍了如何将GMT时间戳转换为Unix时间戳(javascript)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在解析一个rss feed,每个条目都有一个时间戳,如下所示:2009-09-21T21:24:43 + 04:00
有没有办法将这个日期格式转换为unix时间戳使用javascript?

I'm parsing an rss feed and each entry has a timestamp such as this: 2009-09-21T21:24:43+04:00 Is there any way to convert this date format to a unix timestamp with javascript?

我只想记录最新的rss输入日期,但我需要将GMT时间或Unix时间戳的时间标准化为此。

I just want to be able to record the latest rss entry date, but I need to standardize the time to GMT time or Unix timestamp to do this.

推荐答案

格式似乎是ISO-8601。假设情况属实,此博客为此提供了一个javascript解决方案。

The format appears to be ISO-8601. Assuming that is true, this blog provides a javascript solution to this.

这篇关于如何将GMT时间戳转换为Unix时间戳(javascript)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆