Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Local Time Conversion Code/Script
Old 12-31-2009, 03:00 PM Local Time Conversion Code/Script
Skilled Talker

Posts: 51
Name: Mark Strobel
Trades: 0
We facilitate webinars/conferences and post the date/time of the events on our website. Presently, we list the times in various United States time zones to make it easier for viewers to determine what time the event will take place within their time zone. However, posting the date/time in all the time zones makes the event calendar look too busy, cluttered, and somewhat confusing.

Is anyone aware of an html code/script that would allow me to post the times in my time zone (Mountain Standard Time) to where the time is automatically converted to the viewers local time on their computer? If there is a code/script of this nature, then I wouldn’t need to worry about the time zone issue. Thanks.
MarkStrobel3367 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-03-2010, 09:53 AM Re: Local Time Conversion Code/Script
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Code:
function dateAdjust(p_EventDate) {
var localDate = new Date();
var scheduledDate = new Date(p_EventDate);
var msOffset = localDate.getTimezoneOffset() * 60000

return new Date(scheduledDate.valueOf() + msOffset)

}
HTML Code:
<script type="text/javascript">
var s_Event = 'April 15, 2010 15:00'; // Event date and time in GMT/UTC

document.write(' GMT Time of event will be: ' + s_Event);
document.write('<br /><br />')
document.write(' Local Time of event will be: <br />' + dateAdjust(s_Event));
</script> 
Demo at http://www.modtalk.co.uk/_site/code/...to-local-time/
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Local Time Conversion Code/Script
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11514 seconds with 12 queries