Javascript toLocaleDateString时间格式问题(Firefox与Chrome)

Javascript toLocaleDateString时间格式问题(Firefox与Chrome),javascript,google-chrome,datetime,firefox,datetime-format,Javascript,Google Chrome,Datetime,Firefox,Datetime Format,我在Chrome和Firefox中看到此日期格式化命令的不同结果: 新日期(115655040000)。toLocaleDateString('en-us',{weekday:'long',month:'short',day:'numeric',hour12:'false,timeZone:'UTC'})+'z' 在Firefox中,我得到以下结果(这是所需的输出格式): 2008年8月26日星期六” 在Chrome中,我得到以下结果: “2004年8月26日星期六” 很容易检查“24”值并替换

我在Chrome和Firefox中看到此日期格式化命令的不同结果:

新日期(115655040000)。toLocaleDateString('en-us',{weekday:'long',month:'short',day:'numeric',hour12:'false,timeZone:'UTC'})+'z'

在Firefox中,我得到以下结果(这是所需的输出格式):

2008年8月26日星期六”

在Chrome中,我得到以下结果:

“2004年8月26日星期六”

很容易检查“24”值并替换为“00”,但希望有一个内置的方法。。。
在toLocaleDateString格式选项中是否有我缺少的选项,或者获得所需格式的替代方法?

我发现选项“hour12”在Mozilla Firefox和Google Chrome中的工作方式有所不同。在这种情况下,使用选项“”而不是“hour12”可能会有所帮助

new Date(1156550400000).toLocaleDateString('en-us', {weekday: 'long', month: 'short', day: 'numeric', hour: '2-digit', hourCycle: "h23", timeZone: 'UTC'})+'z'
在Mozilla Firefox(82.0(64位))中,它返回
“Saturday,Aug 26,00z”
。在Google Chrome(86.0.4240.111版(官方版本)(64位))中,它返回
“Saturday,Aug 26,00z”

看起来像是一个V8“问题”。这同样发生在node中(在node v12.7.0上测试).这应该行得通,尽管我刚才没有积极地完成那个特定的任务。我现在无法实际测试它…接受它,因为它看起来比我最初的原地工作要优雅得多。