Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old January 29th, 2008, 09:04 AM
Newbie
 
Join Date: Jan 2008
Posts: 17
Smile Getting client TimeZone name in JavaScript

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..
Reply
  #2  
Old January 29th, 2008, 09:52 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,766
Default

Welcome to TheScripts!

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

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 ..
Reply
  #4  
Old February 5th, 2008, 09:06 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,766
Default

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.
Reply
  #5  
Old February 6th, 2008, 08:13 AM
Newbie
 
Join Date: Jan 2008
Posts: 17
Smile

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
Reply
  #6  
Old February 6th, 2008, 08:53 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,766
Default

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.
Reply
  #7  
Old February 7th, 2008, 10:10 AM
Newbie
 
Join Date: Jan 2008
Posts: 17
Default

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
Reply
  #8  
Old February 7th, 2008, 10:25 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,766
Default

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.
Reply
  #9  
Old March 27th, 2008, 07:28 PM
Newbie
 
Join Date: Mar 2008
Posts: 1
Default

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

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

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles