We are often interested in obtaining the client's time zone (ex: America/Los_Angeles
), for obvious reasons. Unfortunately, this isn't directly available within any widely used browser that I know of. Instead, we have to rely on asking the user, or attempting to detect it - with reasonable accuracy - using some Javascript that examines various date offsets (ex: jstz
as described here).
My questions is, why not? Obviously the offset is available, which is based on the time zone. It would save the headache of having to use hacks to determine it, and of course one could always use other means to determine it with more confidence (ex: asking the user). Perhaps there are security implications, a lack of agreement in creating a standard solution, or something else I might be missing. I've done a lot of searching before posting this question and haven't found anything definitive.