You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Chrome哪个版本开始支持Intl.DateTimeFormat()的时区偏移格式?

Intl.DateTimeFormat支持+0500格式时区偏移的Chrome版本
  • 在Chromium 121版本中,以下Intl.DateTimeFormat代码可正常运行:
new Intl.DateTimeFormat('en', {
      dateStyle: 'long',
      timeStyle: 'long',
      timeZone: '+0500',
    }).format(new Date());

执行结果:'February 18, 2024 at 3:42:40 AM GMT+5'

  • 但在Chrome Headless 114.0.5673.0版本中运行相同代码时,会抛出错误:Invalid time zone specified: +0500

这个±HHmm格式的时区偏移支持是从Chrome 118版本开始引入的。该版本对齐了ECMA-402规范的更新,允许在Intl.DateTimeFormat的timeZone选项中使用这种无冒号的直接偏移格式,在此之前仅支持命名时区(如Asia/Kolkata)或带冒号的±HH:mm格式偏移。

内容的提问来源于stack exchange,提问作者Matthieu Riegler

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.29 21:44:59