Get current GMT offset from a timezone identifier
问题 How do I get the current GMT offset from a timezone identifier? Ideally, it would include the long form name too. For example: "America/Los_Angeles" //output: GMT-0700 (Pacific Daylight Time) It would be nice if it worked with ISO strings too, for example: 2020-12-21T03:57:00Z //output: GMT-0800 (Pacific Standard Time) 回答1: You can use the timeZone and timeZoneName options of the Intl.DateTimeFormat object as below to get the name of more common timezones, but lesser known ones will probably