if (document.all||doc..."> if (document.all||doc...">
 
Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Hi Josh,

To convert everything into 12Hr format you need to do use the following in the script:
code:

<script language="JavaScript">
if (document.all||document.getElementById)
document.write('<span id="ClockSpan"></span>')
function ThreadsClock()
{
Now = new Date();
Seconds = Now.getSeconds();
Minutes = Now.getMinutes();
Hours = Now.getHours();
if (Hours < 0) Hours+=24;
if (Hours > 23) Hours-=24;

AMPM = (Hour > 11)?"PM":"AM";

if (Hours == 0) Hours=12;
(Hours < 13)?Hours:Hours %= 12;

var FinalTime = ((Hours < 10)?"0"+Hours:Hours) + ':' + ((Minutes < 10)?"0"+Minutes:Minutes) + ':' + ((Seconds < 10)?"0"+Seconds:Seconds) + ' ' + AMPM;
if (document.all)
ClockSpan.innerHTML = FinalTime + ' | '
else if (document.getElementById)
document.getElementById("ClockSpan").innerHTML = FinalTime + ' | '
else if (document.layers)
{
document.ClockNetscape.document.ClockNetscape2.document.write(FinalTime + ' | ')
document.ClockNetscape.document.ClockNetscape2.document.close()
}
setTimeout('ThreadsClock()',1000);
}
window.onload=ThreadsClock
//-->
</script>
<ilayer id="ClockNetscape" width=100% height=35><layer id="ClockNetscape2" width=100% height=35 left=0 top=0"></layer></ilayer>



Warm regards

Nikos


Nikos
Sponsored Links
Entire Thread
Subject Posted By Posted
Real time clock on threads dimopoulos 11/01/2002 2:43 AM
Re: Real time clock on threads JoshPet 11/01/2002 4:25 AM
Re: Real time clock on threads kaspar 11/01/2002 10:22 PM
Re: Real time clock on threads JustDave 11/01/2002 10:41 PM
Re: Real time clock on threads Dave_L_dup1 11/01/2002 10:49 PM
Re: Real time clock on threads kaspar 11/02/2002 1:11 AM
Re: Real time clock on threads JoshPet 11/02/2002 1:44 AM
Re: Real time clock on threads Dave_L_dup1 11/02/2002 1:46 AM
Re: Real time clock on threads kaspar 11/02/2002 2:04 AM
Re: Real time clock on threads Dave_L_dup1 11/02/2002 2:15 AM
Re: Real time clock on threads kaspar 11/02/2002 2:40 AM
Re: Real time clock on threads Dave_L_dup1 11/02/2002 3:38 AM
Re: Real time clock on threads kaspar 11/02/2002 4:14 AM
Re: Real time clock on threads JustDave 11/02/2002 5:28 AM
Re: Real time clock on threads JustDave 11/02/2002 6:33 AM
Re: Real time clock on threads caymuc 11/02/2002 12:59 PM
Re: Real time clock on threads JustDave 11/02/2002 3:42 PM
Re: Real time clock on threads dimopoulos 11/05/2002 11:56 AM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
• Shock Hosting
• Stable Host
• bluehost
• InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,583
Posts293,957
Members13,826
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 2461
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 5
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20261026)