我的日期字符串如yyyy-MM-dd HH:mm:ss.SSS
是PST时区,我需要将其更改为UTC格式2016-07-28T17:22:51.916Z
。我怎么能这样做?
答案 0 :(得分:0)
这可以在JS中轻松完成:
var pstDate = new Date(myValidPstDateString);
// ISO is always in UTC time
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
console.log(pstDate.toISOString());