🕒 System/GMT Time - Solved!

I’m currently using a variation of this.

The only change I made was to negate the return value, as I’m converting from UTC to local time, so I need the local offset rather than the UTC offset. (If you read the docs for getTimezoneOffset, you’ll see it returns the difference between UTC and local - so it gives the UTC offset from local time, as opposed to the local offset from UTC time)

So I’m using:

return -(new Date().getTimezoneOffset())/60

I think that’s probably going to be the most reliable solution for now.

3 Likes