I want to output the users system timezone, e.g. “EST”. How can I do that, preferably using Javascript, though I could do it on the PHP side as well, if that’s significantly easier.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will have to use Javascript – since you do not know the client timezone on the server side. You could use the code below and extract the relevant timezone string from localtime.
which will return something like “12:21:44 GMT-0400 (EDT)”