【发布时间】:2018-10-10 19:23:03
【问题描述】:
希望使用Date.prototype.toLocaleTimeString 格式化Date 对象,如下所示:
new Date().toLocaleTimeString('en', {hour: '2-digit', minute: '2-digit', second: '2-digit', timeZoneName: 'short'})
在 Chrome 和 Firefox 中,我得到如下结果:
铬:"3:18:34 PM EDT"
火狐:"3:19:17 PM EDT"
但是,在 IE 中,我得到如下结果:
IE11:"03:19:54 PM" 注意缺少“EDT”。
我看到here on MDN IE11 应该完全支持此函数的options 参数。我是否遗漏了什么,或者真的没有办法让语言环境格式的字符串包含时区名称。
【问题讨论】:
标签: javascript internet-explorer timezone