Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

gettimezoneoffset is wrong - shows -0600 when it should be +1000

  • 2 回覆
  • 1 有這個問題
  • 23 次檢視
  • 最近回覆由 cor-el

more options

Going to http://www.localeplanet.com/support/browser.html shows:

*****

navigator.browserLanguage: undefined

navigator.language: en-GB

navigator.userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0

date: Wed Dec 25 2019 10:19:57 GMT+1000 (Australian Eastern Standard Time)

date.toLocaleDateString(): 25/12/2019

date.toLocaleTimeString(): 10:19:57

date.toLocaleString(): 25/12/2019, 10:19:57

date.toUTCString(): Wed, 25 Dec 2019 00:19:57 GMT

date.getTimezoneOffset(): -600

*****

This produces errors in some web pages.

Going to http://www.localeplanet.com/support/browser.html shows: ***** navigator.browserLanguage: undefined navigator.language: en-GB navigator.userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0 date: Wed Dec 25 2019 10:19:57 GMT+1000 (Australian Eastern Standard Time) date.toLocaleDateString(): 25/12/2019 date.toLocaleTimeString(): 10:19:57 date.toLocaleString(): 25/12/2019, 10:19:57 date.toUTCString(): Wed, 25 Dec 2019 00:19:57 GMT date.getTimezoneOffset(): -600 ***** This produces errors in some web pages.

由 brisdaz 於 修改

所有回覆 (2)

more options

I think that is correct.

My time zone offset is 480, or 8 hours x 60 minutes behind GMT.

Your -600 represents 10 hours x 60 minutes ahead of GMT.

Merry Christmas!

Ref. https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset

由 jscher2000 - Support Volunteer 於 修改

more options
  • (new Date()).toLocaleString("en-AU",{"timeZoneName":"short"});