3 ms·
A few lines of Javascript can tell you which timezone the user's machine is set to. That is simply not true. You can get the localized timezone as provided by
by snprbob86 16y ago
A few lines of Javascript can tell you which timezone the user's machine is set to.
That is simply not true. You can get the localized timezone as provided by the user's operating system. You would need a server side mapping of every time zone in language for both Olson and Windows. Even then, there are ambiguous timezone names, etc.
The best you can do reasonably is calculate GMT offset, presence of daylight savings time, and if DST is present, then which hemisphere the user is in. From there, you can guess at a city/region with the largest population.
See here: https://bitbucket.org/pellepim/jstimezonedetect/overview https://bitbucket.org/pellepim/jstimezonedetect/overview
- bhousel 16y agoApologies for not being precise enough (I actually posted that same link in a response below). With Javascript you can get the user's GMT offset and DST observance. You can't get the political name of the timezone or precise mapping to Olsen database. But for the purposes of scheduling meetings, what you get with Javascript is fine.