I am in the 'Asia/Shanghai' time zone and have set my computer system's time zone accordingly. However, when I retrieve the time zone using Chrome's console, the returned result is 'America/Chicago'.
Intl.DateTimeFormat().resolvedOptions().timeZone
'America/Chicago'
When I use Date(), I obtain the time in the correct time zone, and the obtained time zone offset through the function (new Date().getTimezoneOffset()) is -480, which is also correct.
new Date()
Fri Oct 13 2023 10:24:20 GMT+0800 <--Asia/Shanghai
new Date().getTimezoneOffset()
-480 <--Asia/Shanghai
Now my question is ,Why does Intl.DateTimeFormat().resolvedOptions().timeZone not match the time zone obtained from Date()?
How can I fix the issue with Intl.DateTimeFormat().resolvedOptions().timeZone returning the wrong time zone?
I tried on other computers, and the results were normal.