如何使用JavaScript提取UTC日期? [英] How to fetch UTC dates with JavaScript?
本文介绍了如何使用JavaScript提取UTC日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用Javascript获取当前的UTC日期。我怎样才能做到这一点?似乎有一些方法可以获取UTC时间:
I want to get the current UTC date with Javascript. How can I do this? There seems to be methods for getting the time in UTC:
date.getUTCHours();
如何获取日期?
推荐答案
有日期,天,整年,小时,分钟,月份,等。要明确获取日期,您可能会发现 getUTCDate 很有用。
There are UTC getters for date, day, full year, hour, minutes, month, etc. To get the date specifically, you might find getUTCDate useful.
没有看到更多代码,我只能建议这样做:
Without seeing more of your code, I can only suggest this:
date.getUTCDate();
这篇关于如何使用JavaScript提取UTC日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文