I have this so far:
As you can see, I want it to just display a couple of links in the header, and then display the date. (I am in Boston according to my profile so I used that.)
I also tried to put it in it's own .js file and calling it externally and placing that line of code in the part of the HTML. But even then, I have no idea how to call it in the place I want it to be called (after the links). Please help?
Thanks in advance!
Add a div to your code where you want to display the time, such as
and then, instead of document.write... use:
If you want your time to be updated constantly, use setInterval, as in:
setInterval( \\YOUR FUNCTION HERE ,1000);
That will recalculate the time and redisplay it every 1000 ms (=1s).
EDIT: As mentioned by Jon P, you have to call the function (and not only define it). A way to do it is to call it once the page body has loaded. All you have to do is adding it to your body tag as in:
Alternatively, you can just call it inside your script, as in
Also, as mentioned by Samurai, don't forget to correct your typo: getMinutes() instead of getMiutes()