Joh*_*ohn 6 html javascript jquery momentjs dayjs
我最近在使用 momentjs,但刚刚切换到 dayjs。但是,我需要获取时区列表。使用 momentjs 非常简单:moment.tz().names(),但是使用 dayjs 我不知道如何做到这一点。我不想获得 500 多个时区,而是需要更短、更紧凑的列表,考虑到冬季/夏季时间的变化。
任何想法 ?
小智 2
在浏览器控制台中使用以下代码
for (const timeZone of Intl.supportedValuesOf('timeZone')) {console.log(timeZone)}
Run Code Online (Sandbox Code Playgroud)