Connecting Tech Pros Worldwide Help | Site Map

Getting client TimeZone name in JavaScript

  #1  
Old January 29th, 2008, 09:04 AM
Newbie
 
Join Date: Jan 2008
Posts: 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..
  #2  
Old January 29th, 2008, 09:52 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,526
Provided Answers: 12

re: Getting client TimeZone name in JavaScript


Welcome to TheScripts!

Use the Date object methods.
  #3  
Old February 5th, 2008, 05:45 AM
Newbie
 
Join Date: Jan 2008
Posts: 17

re: Getting client TimeZone name in JavaScript


Quote:
Originally Posted by acoder
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 ..
  #4  
Old February 5th, 2008, 09:06 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,526
Provided Answers: 12

re: Getting client TimeZone name in JavaScript


Quote:
Originally Posted by praveen1983
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.
  #5  
Old February 6th, 2008, 08:13 AM
Newbie
 
Join Date: Jan 2008
Posts: 17

re: Getting client TimeZone name in JavaScript


Quote:
Originally Posted by acoder
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
  #6  
Old February 6th, 2008, 08:53 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,526
Provided Answers: 12

re: Getting client TimeZone name in JavaScript


Quote:
Originally Posted by praveen1983
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.
  #7  
Old February 7th, 2008, 10:10 AM
Newbie
 
Join Date: Jan 2008
Posts: 17

re: Getting client TimeZone name in JavaScript


Quote:
Originally Posted by acoder
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
  #8  
Old February 7th, 2008, 10:25 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,526
Provided Answers: 12

re: Getting client TimeZone name in JavaScript


Quote:
Originally Posted by praveen1983
k.. thank u for ur posts & replies
No problem, glad to help. Post your solution here or, if you get stuck, post your code.
  #9  
Old March 27th, 2008, 07:28 PM
Newbie
 
Join Date: Mar 2008
Posts: 1

re: Getting client TimeZone name in JavaScript


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
  #10  
Old March 31st, 2008, 07:10 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,526
Provided Answers: 12

re: Getting client TimeZone name in JavaScript


Read the answer I gave earlier. You'll have to program it yourself based on the time zone offset.
Reply