User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 374,174 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,464 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 714 | Replies: 6
Reply
Join Date: Nov 2007
Location: Banjaluka,RS,Bosnia
Posts: 283
Reputation: kv79 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 7
kv79 kv79 is offline Offline
Posting Whiz in Training

Display a clock

  #1  
Mar 8th, 2008
Hi all,
I do not know where to put these Thread , so I am hoping that you will answer me here .

http://www.w3schools.com/js/tryit.asp?filename=tryjs_timing_clock


I do not understand why these code display clock .


Thank you for your effort of reading .
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2007
Posts: 94
Reputation: Designer_101 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
Designer_101 Designer_101 is offline Offline
Junior Poster in Training

Re: Display a clock

  #2  
Mar 8th, 2008
hi

var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();


All this is doing is pulling the date from your local computer (little clock in the bottom right corner (on xp). And storing the hours, mins and seconds in variables.

the rest of the script is a bit usless and just makes it look complicated. All it does is add 0's and stuff.

This is quite simple javascript, so if you are just hopping, trying to grasp the language, i would suggest to start at the beggining and go slowly making sure you understand peices before moving on.

Reece
Reply With Quote  
Join Date: Nov 2007
Location: Banjaluka,RS,Bosnia
Posts: 283
Reputation: kv79 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 7
kv79 kv79 is offline Offline
Posting Whiz in Training

Re: Display a clock

  #3  
Mar 8th, 2008
But this code is not give me a null if number in lower that 10 . It was a 2 hour when i learn these and i did not see any null .
Reply With Quote  
Join Date: Jul 2007
Posts: 94
Reputation: Designer_101 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
Designer_101 Designer_101 is offline Offline
Junior Poster in Training

Re: Display a clock

  #4  
Mar 8th, 2008
all thats doing is adding a 0, if the number is less than 10??
I dont understand what your asking?
Reece
Reply With Quote  
Join Date: Nov 2007
Location: Banjaluka,RS,Bosnia
Posts: 283
Reputation: kv79 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 7
kv79 kv79 is offline Offline
Posting Whiz in Training

Re: Display a clock

  #5  
Mar 8th, 2008
Test it with your clock . It is all i want to say is that not working .
Reply With Quote  
Join Date: Jul 2007
Posts: 94
Reputation: Designer_101 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
Designer_101 Designer_101 is offline Offline
Junior Poster in Training

Re: Display a clock

  #6  
Mar 9th, 2008
its working fine for me
what browser are you using? there may be a problem, for instance
Javascript could be turned of
Your Clock is covered by a firewall (highly unlikely)
Reply With Quote  
Join Date: Nov 2007
Location: Banjaluka,RS,Bosnia
Posts: 283
Reputation: kv79 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 7
kv79 kv79 is offline Offline
Posting Whiz in Training

Re: Display a clock

  #7  
Mar 9th, 2008
Java script is on and i am using a firefox 2.0.0.12
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb HTML and CSS Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the HTML and CSS Forum

All times are GMT -4. The time now is 4:25 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC