vForums Support Banner Image



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Database of Codes/Hacks/Mods :: View Topic - Time in Menu Bar (Page 2 of 2)
     1,  2Printable View
Wrighty
Very Senior Member
*****

[Avatar]

Posts: 3,269
Status: Offline
Gender: Male
Joined: 16th Dec 2007
Reputation: 16%  



Re: Time in Menu Bar (31st Dec 07 at 1:00am)
Post a request to have it changed! Smiley

it'd be sooo much easier! Smiley
Back to Top - Link to Post

Image
ManGoneMad
New Member
*

[Avatar]

Posts: 14
Status: Offline
Gender: Male
Location: West Coast of Michigan
Age: 49
Joined: 31st Dec 2007
Reputation: 0%  



Re: Time in Menu Bar (31st Dec 07 at 1:10am)
Ok, Thanks will do!
Back to Top - Link to Post

Mad House Creations
Image

Image
Danny
Full Member
***

[Avatar]

Posts: 180
Status: Offline
Gender: Male
Location: Durham
Age: 17
Joined: 30th Dec 2007
Reputation: 0%  



Re: Time in Menu Bar (31st Dec 07 at 1:19am)
you mean so after 12 o clock it goes back to 1 each time ?
Back to Top - Link to Post

Myspace | deviantART

"Suffer For Your Art"
Wrighty
Very Senior Member
*****

[Avatar]

Posts: 3,269
Status: Offline
Gender: Male
Joined: 16th Dec 2007
Reputation: 16%  



Re: Time in Menu Bar (31st Dec 07 at 1:20am)
Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*Time to the left of menu butons by Danny*/
  4.  
  5. function startTime(){
  6. var today=new Date()
  7. var h=today.getHours()
  8. var m=today.getMinutes()
  9. var s=today.getSeconds()
  10. m=checkTime(m)
  11. s=checkTime(s)
  12. e = 'am'
  13. if(h=="12"){
  14. e = "pm";
  15. }
  16. if(h=='0'){
  17. h="12";
  18. }else if(h>12){
  19. h=parseInt(h - 12);
  20. e = "pm"
  21. }
  22.  
  23.  
  24. document.getElementById('time').innerHTML=h+":"+m+":"+s + " " + e
  25. t=setTimeout('startTime()',999)}
  26. function checkTime(i){
  27. if (i<10) {
  28. i="0" + i}
  29. return i}
  30.  
  31. var menu = document.getElementById('welcome_table').getElementsByTagName('td')[2];
  32.  
  33. menu.innerHTML = '<span style="float:right;" id="time"></span>' + menu.innerHTML;
  34.  
  35. window.onload = startTime();
  36.  
  37. //-->
  38. </script>
 


Smiley Editted, hope you don't mind Danny... Feel free to clean up the code! Smiley
Back to Top - Link to Post

Image
Ajay
Senior Member
****

[Avatar]

Posts: 508
Status: Offline
Gender: Male
Location: Virtualforums Support
Age: 15
Joined: 19th Feb 2008
Reputation: 0%  



Re: Time in Menu Bar (20th Feb 08 at 4:58pm)
Thanks for the code!
Back to Top - Link to Post

Image
     1,  2Printable View

All times are GMT+1 :: The current time is 5:58pm
Page generated in 0.8303 seconds
with 17 Database Queries and 8 cache files
This Forum is Powered By vForums
Create a Forum for Free