我有一个UTC日期时间字符串和时区名称。我从第三方API获取此信息。我需要使用JavaScript/NodeJS将UTC时间转换为该时区的本地时间,并获取该时区的当前时间。有没有相同的图书馆/方法?JavaScript:使用时区将UTC时间转换为本地时间
var timezone = "America/New_York";//This will always be in Olson format.
var UTCTime = "2017-09-03T02:00:00Z";
var localTime; //I need to find the equivalent of UTCTime for America/New_York
var currentTime; //Current time of time zone America/New_York
有用的资源https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date – Atiq
时刻(http://momentjs.com/docs/)是一个非常强大和流行的日期操作库,很可能你的需求可以被它覆盖。 – tibetty