Normally new Date()
returns the time, time-zone and region, like Thu Sep 02 2021 15:04:30 GMT+0800 (Taipei Standard Time)
, but for some reason two of my colleague's computer isn't returning the region, and only shows something like Thu Sep 02 2021 15:04:30 GMT+0800 (GMT+8)
.
I originally discovered this because when we use moment-timezone's moment.tz.guess()
, it returns Etc/GMT-8
instead of Aisa/Taipei
, and thought it might have something to do with the browser not being able to get the user's location, as mentioned in moment.js' official docs.
We're sure it's not a browser issue though, since we've tested it on Edge, Chrome and Firefox.
Any ideas on why this happens?
Ok we tested it out, and it IS an issue with the OS's settings.
So the computers' regions are both initially set to Taiwan, and what we did was we tried setting it to elsewhere, then setting it back again. And...for some reason that did the trick.
Weird, but I guess strange things just happens on Windows.
But thanks for all the replies! Hopefully this can help another confused user in the future...