我尝试使用moment-timezone修改时间戳时区,我希望使用应用的偏移量获取修改后的值
var newTimestamp = momentTz.tz(timestamp, 'Europe/Berlin')
所以这就是我的尝试
var results = {};
for (var timestamp in timestamps) {
var commitCount = timestamps[timestamp];
console.log(typeof timestamp)
console.log(timestamp)
console.log(moment(timestamp).format())
//console.log(moment.tz(timestamp, 'Europe/Berlin'))
//results[ moment.tz(timestamp, 'Europe/Berlin')] = commitCount;
};
这是日志
的摘录string
1528063200
Invalid date
如何获取新时间戳?