JSFiddle - React, Tailwind, and code Playground

by Frank Liu

JavaScript

const d = new Date(); // or whatever date you have
      const tzName = d.toLocaleString('en', { timeZoneName: 'short' }) //.split(' ').pop();
      console.log('获取时区:', tzName);
      
      console.log(Intl.DateTimeFormat().resolvedOptions().timeZone)