var mydate = new Date(); var mytoday = mydate.getDate();
How to change that to hours instead of days. I tried just changing it to hours right before the brackets but it won't work.
Please let me know, thanks.
Simone100
7:52 am on Oct 20, 2006 (gmt 0)
OK I got it, I forgot to capitalize the "H" in getHours.
I am puzzled though. When I use this it starts on the first hour instead of the hours we are in.
But when I use date it starts on the correct date. Anyone know whats up with that? Please let me know, thanks!
DrDoc
8:00 am on Oct 20, 2006 (gmt 0)
mydate.getHours()
should print the current hour. Not sure why it doesn't do that for you. For example, if the time is 8:35 am,
getHours()
returns 8, and
getMinutes()
returns 35.
Simone100
8:57 am on Oct 20, 2006 (gmt 0)
I found out what my problem is. It doesn't keep going. It only shows the new hour on page load. Anyway to have it automatically change to the new hour while the page stays open?
inveni0
11:26 am on Oct 20, 2006 (gmt 0)
You'll need to write code to:
1) update the clock every second or 2) get the time and count the seconds on its own