var today = new Date();
var dateOptions = {
weekday:"long",
day: "numeric",
month: "long",
year: "numeric"
};
var day = today.toLocaleDateString("en-US", dateOptions);
var date = new Date().toUTCString()
var hour = new Date().getUTCHours()
var day = new Date().getUTCDate()
var month = new Date().getUTCMonth()
var year = new Date().getUTCFullYear()
var mstime = new Date().getUTCMilliseconds()
console.log(date)
console.log(hour)
console.log(day)
console.log(month)
console.log(year)
console.log(mstime)
//! expected output
Date : Sun, 23 Oct 2022 17:49:20 GMT
Hour : 17
Day : 23
Month : 9
Year : 2022
Get a time but in ms : 1666547360034
1条答案
按热度按时间oxcyiej71#
你什么意思?你可以用