DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   HTML and CSS (http://www.daniweb.com/forums/forum143.html)
-   -   Display a clock (http://www.daniweb.com/forums/thread112843.html)

kv79 Mar 8th, 2008 11:11 am
Display a clock
 
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 .

Designer_101 Mar 8th, 2008 11:17 am
Re: Display a clock
 
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

kv79 Mar 8th, 2008 11:41 am
Re: Display a clock
 
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 .

Designer_101 Mar 8th, 2008 1:56 pm
Re: Display a clock
 
all thats doing is adding a 0, if the number is less than 10??
I dont understand what your asking? :S
Reece

kv79 Mar 8th, 2008 5:05 pm
Re: Display a clock
 
Test it with your clock . It is all i want to say is that not working .

Designer_101 Mar 9th, 2008 6:09 am
Re: Display a clock
 
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)

kv79 Mar 9th, 2008 1:15 pm
Re: Display a clock
 
Java script is on and i am using a firefox 2.0.0.12


All times are GMT -4. The time now is 3:59 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC