Sök i support

Akta dig för supportbedrägerier: Vi kommer aldrig att be dig att ringa eller skicka ett sms till ett telefonnummer eller dela personlig information. Rapportera misstänkt aktivitet med alternativet "Rapportera missbruk".

Läs mer

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

  • 2 svar
  • 1 har detta problem
  • 23 visningar
  • Senaste svar av 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.

Ändrad av brisdaz

Alla svar (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

Ändrad av jscher2000 - Support Volunteer

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