Standard way for a web server to determine what time zone offset a user is in?

How to determine web users time zone?

1 Like

The most popular (==standard?) way of determining the time zone I’ve seen around is simply asking the user ximself. If your website requires subscription, this could be saved in the users’ profile data. For anon users, the dates could be displayed as UTC or GMT or some such.

I'm not trying to be a smart-alec. It's just that sometimes some problems have finer solutions outside of any programming context.

Try this one:

new Date().getTimezoneOffset()/60;