Global Header
Preview
No need to edit![]()
Code:
- <script type="text/javascript">
- <!--
- /*Time to the left of menu butons by Danny*/
- function startTime(){
- var today=new Date()
- var h=today.getHours()
- var m=today.getMinutes()
- var s=today.getSeconds()
- m=checkTime(m)
- s=checkTime(s)
- document.getElementById('time').innerHTML=h+":"+m+":"+s
- t=setTimeout('startTime()',500)}
- function checkTime(i){
- if (i<10) {
- i="0" + i}
- return i}
- var menu = document.getElementById('welcome_table').getElementsByTagName('td')[2];
- menu.innerHTML = '<span style="float:right;" id="time"></span>' + menu.innerHTML;
- window.onload = startTime();
- //-->
- </script>
have you tested this?
yeah il add a preview![]()
looks good!![]()
thanks man![]()
Just so you know, the time shows up to the right of the menu buttons, not the left.![]()
lol it's coded to go right, but the Copyright says left!![]()
lol it's coded to go right, but the Copyright says left!![]()
That's pretty much what I just said.![]()
and I was just reiterating it cause it was funny! >.>
and I was just reiterating it cause it was funny! >.>
Ahh, that works.![]()
oops I meant to say rightI even put float:right; in the code
![]()
oops I meant to say rightI even put float:right; in the code
![]()
Haha, no problem.![]()
menu.innerHTML = '<span style="float:right;" id="time"></span>'+menu.innerHTML+'';
It needs only be;
menu.innerHTML = '<span style="float:right;" id="time"></span>'+menu.innerHTML;
Because, you can't actually add nothing to the end of something.![]()
just changed it![]()
Nice script!![]()
Is there any way to have show normal 12 hour time, as opposed to military time?
Post a request to have it changed!![]()
it'd be sooo much easier!![]()
Ok, Thanks will do!
you mean so after 12 o clock it goes back to 1 each time ?
Code:
- <script type="text/javascript">
- <!--
- /*Time to the left of menu butons by Danny*/
- function startTime(){
- var today=new Date()
- var h=today.getHours()
- var m=today.getMinutes()
- var s=today.getSeconds()
- m=checkTime(m)
- s=checkTime(s)
- e = 'am'
- if(h=="12"){
- e = "pm";
- }
- if(h=='0'){
- h="12";
- }else if(h>12){
- h=parseInt(h - 12);
- e = "pm"
- }
- document.getElementById('time').innerHTML=h+":"+m+":"+s + " " + e
- t=setTimeout('startTime()',999)}
- function checkTime(i){
- if (i<10) {
- i="0" + i}
- return i}
- var menu = document.getElementById('welcome_table').getElementsByTagName('td')[2];
- menu.innerHTML = '<span style="float:right;" id="time"></span>' + menu.innerHTML;
- window.onload = startTime();
- //-->
- </script>
Editted, hope you don't mind Danny... Feel free to clean up the code!
![]()
Thanks for the code!