By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,930 Members | 1,383 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,930 IT Pros & Developers. It's quick & easy.

Getting client TimeZone name in JavaScript

P: 17
i want to get client TimeZone name .for ex .if i am changing my timezone to CST it should change in my prgm thru javascript,and then it has to show the TimeZone name and current time also..
Jan 29 '08 #1
Share this Question
Share on Google+
9 Replies


acoder
Expert Mod 15k+
P: 16,027
Welcome to TheScripts!

Use the Date object methods.
Jan 29 '08 #2

P: 17
Welcome to TheScripts!

Use the Date object methods.
not the time.. i want to get the timezone name .. for Ex.. now i am using IST ,if i am changing the India Standard Time to Eastern standad Time it has To change to EST ..
Feb 5 '08 #3

acoder
Expert Mod 15k+
P: 16,027
not the time.. i want to get the timezone name .. for Ex.. now i am using IST ,if i am changing the India Standard Time to Eastern standad Time it has To change to EST ..
Make use of getTimezoneOffset(), toLocaleString(), etc. to calculate it yourself.
Feb 5 '08 #4

P: 17
Make use of getTimezoneOffset(), toLocaleString(), etc. to calculate it yourself.
i dont want a time.. i need a Eastern standard time this name to be changed..when i change my timezone to another
Feb 6 '08 #5

acoder
Expert Mod 15k+
P: 16,027
i dont want a time.. i need a Eastern standard time this name to be changed..when i change my timezone to another
I know you want a timezone name rather than a time. What I'm saying is that you'll have to calculate the name of the timezone using the time.
Feb 6 '08 #6

P: 17
I know you want a timezone name rather than a time. What I'm saying is that you'll have to calculate the name of the timezone using the time.
k.. thank u for ur posts & replies
Feb 7 '08 #7

acoder
Expert Mod 15k+
P: 16,027
k.. thank u for ur posts & replies
No problem, glad to help. Post your solution here or, if you get stuck, post your code.
Feb 7 '08 #8

P: 1
I have the similar issue:

I want to get the time zone name from JavaScript and use that in Java.
TimeZone tz =TimeZone.getTimeZone("timezonenamegotfromjavascript");
.

Thanks for your help.
- jd
Mar 27 '08 #9

acoder
Expert Mod 15k+
P: 16,027
Read the answer I gave earlier. You'll have to program it yourself based on the time zone offset.
Mar 31 '08 #10

Post your reply

Sign in to post your reply or Sign up for a free account.