Go Back   Dynamic Drive Forums > DD Scripts > Dynamic Drive scripts help
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #1  
Old 10-24-2004, 05:49 PM
bmdavis bmdavis is offline
Junior Coders
 
Join Date: Oct 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default International Time Script

I have noticed a few scripts on the page that display clocks on the web page. Any way you can change the script to display the time in, for example, London?

Thanks.
Reply With Quote
  #2  
Old 10-24-2004, 06:14 PM
cr3ative's Avatar
cr3ative cr3ative is offline
Elite Coders
 
Join Date: Aug 2004
Location: Brighton
Posts: 1,564
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, I could modify a script for you. It would take the user's system time and modify it by +x or -x hours.
Pick any clock script, with a llink to it here if this is what you mean.

cr3ative
__________________
Mostly retired member, PM me if you have a specific query to make sure I recieve it :)
cr3ation | cr3ation hosting | cr3ation web design | read the stickies

Last edited by cr3ative; 10-24-2004 at 06:21 PM.
Reply With Quote
  #3  
Old 11-04-2004, 05:28 AM
bmdavis bmdavis is offline
Junior Coders
 
Join Date: Oct 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sounds good

http://www.dynamicdrive.com/dynamicindex6/clock3.htm

Just tell me where to edit.


Also, will it make a different if people are accessing it on different coasts of the U.S.? (can you just add a simple +8 for London?)
Reply With Quote
  #4  
Old 11-04-2004, 08:48 AM
cr3ative's Avatar
cr3ative cr3ative is offline
Elite Coders
 
Join Date: Aug 2004
Location: Brighton
Posts: 1,564
Thanks: 0
Thanked 0 Times in 0 Posts
Default

var hours=mydate.getHours()+1

Would add one hour to this script.

cr3ative
__________________
Mostly retired member, PM me if you have a specific query to make sure I recieve it :)
cr3ation | cr3ation hosting | cr3ation web design | read the stickies
Reply With Quote
  #5  
Old 11-04-2004, 08:10 PM
ddadmin's Avatar
ddadmin ddadmin is offline
Administrator
 
Join Date: Aug 2004
Posts: 7,627
Thanks: 2
Thanked 639 Times in 629 Posts
Blog Entries: 13
Default

It's actually a little more complicated than that, unfortunately. Since you have no idea what time zone the user is in, you'll need to use either the Date.getTimezoneOffset() function or some other fixed time function to eventually determine the current time that doesn't change regardless of what the user's timezone is. Unfortunately due to time constraints I can't make the modications for you, though try searching on Google for such an example...
Reply With Quote
  #6  
Old 11-05-2004, 12:36 PM
cr3ative's Avatar
cr3ative cr3ative is offline
Elite Coders
 
Join Date: Aug 2004
Location: Brighton
Posts: 1,564
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well yes, ideally it would get the time from a world time server, but they all seem to have no support for projects like this.

I forgot to mention that it relies entirely on the system clock

cr3ative
__________________
Mostly retired member, PM me if you have a specific query to make sure I recieve it :)
cr3ation | cr3ation hosting | cr3ation web design | read the stickies
Reply With Quote
  #7  
Old 11-05-2004, 06:53 PM
ddadmin's Avatar
ddadmin ddadmin is offline
Administrator
 
Join Date: Aug 2004
Posts: 7,627
Thanks: 2
Thanked 639 Times in 629 Posts
Blog Entries: 13
Default

Quote:
Originally Posted by cr3ative
Well yes, ideally it would get the time from a world time server, but they all seem to have no support for projects like this.

I forgot to mention that it relies entirely on the system clock

cr3ative
Yep, if your page is PHP for example, you can use PHP to write out a variable in JavaScript containing the system clock, then simply increment that by x hours depending on the World time you want to display.
Reply With Quote
Reply

Bookmarks

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

Forum Jump


All times are GMT. The time now is 04:20 AM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.