How to fetch UTC dates with JavaScript?

我与影子孤独终老i 提交于 2019-12-20 04:30:48

问题


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();

How can I get the date?


回答1:


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();


来源:https://stackoverflow.com/questions/2650328/how-to-fetch-utc-dates-with-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!