我试图向 api 发送一个 asp.net UTC 时间戳,如下所示:
d = new Date()
test = moment(d).utc().valueOf()
test2 = moment(d).utc().format("ZZ")
utc_asp = "/Date("+test+test2+")/"
console.log utc_asp
>> /Date(1372670700799+0000)/
但是服务器获取的时间和本地时间一样吗?
或这个:
console.log moment(d)
console.log moment(d).utc()
D {_i: Mon Jul 01 2013 11:26:10 GMT+0200 (SAST), _f: undefined, _l: undefined, _isUTC: false, _d: Mon Jul 01 2013 11:26:10 GMT+0200 (SAST)…}
index.js:39
D {_i: Mon Jul 01 2013 11:26:10 GMT+0200 (SAST), _f: undefined, _l: undefined, _isUTC: true, _d: Mon Jul 01 2013 11:26:10 GMT+0200 (SAST)…}
这样做:
console.log moment(now).utc().hour()
>> 9 - This is correct! Its 11 - 2, but how come the above
我做错了吗?