Any good javascripters out there? - PlanetSide Universe
PSU Social Facebook Twitter Twitter YouTube Steam TwitchTV
PlanetSide Universe
PSU: Down with Google-related brain-damage!
Home Forum Chat Wiki Social AGN PS2 Stats
Notices
Go Back   PlanetSide Universe > General Forums > The Lounge

Reply
 
Thread Tools Search this Thread Display Modes
Old 2007-08-20, 02:26 PM   [Ignore Me] #1
Strygun
Contributor
Major General
 
Strygun's Avatar
 
Any good javascripters out there?


Hey folks,

I've got a simple, easy JS clock that I'm trying to edit slightly. I need this script to be editable by timezone (in other words, I need to make it so I can control in which timezone the clock displays time.)

here's what I've got... do what you can!
Code:
<script type="text/javascript">
function createtime()
{
var time = new Date()
var hours = time.getHours()
var minutes = time.getMinutes()
var seconds = time.getSeconds()
var abbrev = "AM"
if (hours>=12)
abbrev="PM"
if (hours>12)
{
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var ctime=""+hours+":"+minutes+":"+seconds+" "+abbrev+""
if (document.all)
document.all.clock.innerHTML=ctime
else if (document.getElementById)
document.getElementById("clock").innerHTML=ctime
else
document.write(ctime) }
if (!document.all&&!document.getElementById)
createtime()
function loadtime()
{
if (document.all||document.getElementById)
setInterval("createtime()",1000)
}
</script>
<body onLoad="loadtime()">
<center><font size="1.5">London: <span id="clock"></span></font>
__________________
Strygun is offline  
Reply With Quote
Reply
  PlanetSide Universe > General Forums > The Lounge

Bookmarks

Discord


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:46 AM.

Content © 2002-2013, PlanetSide-Universe.com, All rights reserved.
PlanetSide and the SOE logo are registered trademarks of Sony Online Entertainment Inc. © 2004 Sony Online Entertainment Inc. All rights reserved.
All other trademarks or tradenames are properties of their respective owners.
Powered by vBulletin
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.