1
我需要得到以秒为单位的UTC时间(周三11月7日0点50分28秒格林尼治标准时间,我需要它返回:1352249428)获得UTC时间(秒)使用JavaScript
我有这个代码现在:
current_date = new Date()
var x_timestamp = current_date.getUTCSeconds();
,但它的返回28.00
帮助。由于
我需要得到以秒为单位的UTC时间(周三11月7日0点50分28秒格林尼治标准时间,我需要它返回:1352249428)获得UTC时间(秒)使用JavaScript
我有这个代码现在:
current_date = new Date()
var x_timestamp = current_date.getUTCSeconds();
,但它的返回28.00
帮助。由于
尝试调用UTC
关你的约会对象,并除以结果通过1000
看吧 - http://stackoverflow.com/questions/8047616/get-a-utc-timestamp-in-javascript – ShadyKiller
HTTP ://www.w3schools.com/jsref/jsref_utc.asp – inhan
getTime()/ 1000应该完成这项工作 –