[英]Instantiate a Date object, given time as a string and a timezone?
I have a PST time in String format, I need to convert this to a String in system time.我有一个字符串格式的 PST 时间,我需要将其转换为系统时间的字符串。
moment.js
isn't working for me right now since moment.tz("1970-8-31 1:15", "America/Los_Angeles");
自
moment.tz("1970-8-31 1:15", "America/Los_Angeles");
以来, moment.js
现在不适合我throws a TypeError: _moment.default.tz is not a function
error.引发
TypeError: _moment.default.tz is not a function
错误。
This should work.这应该有效。
const moment = require('moment-timezone');
var june = moment("1970-8-31 1:15");
console.log(june.tz('America/Los_Angeles').format('ha z'));
// or
console.log(moment(june).tz('America/Los_Angeles').format('ha z'))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.