PDA

View Full Version : I need the LCD clock in 24 hour format



dovidshmuel
03-20-2009, 04:28 AM
1) Script Title: LCD clock

2) Script URL (on DD):http://www.dynamicdrive.com/dynamicindex6/lcdclock.htm

3) Describe problem: I need the LCD clock in a 24 hour format without the AM and PM. Can someone tell me the script for it? Thanks.

thetestingsite
03-20-2009, 04:43 AM
In the script itself, find and remove the highlighted below:



<script>
<!--

/*****************************************
* LCD Clock script- by Javascriptkit.com
* Featured on/available at http://www.dynamicdrive.com/
* This notice must stay intact for use
*****************************************/

var alternate=0
var standardbrowser=!document.all&&!document.getElementById

if (standardbrowser)
document.write('<form name="tick"><input type="text" name="tock" size="6"></form>')

function show(){
if (!standardbrowser)
var clockobj=document.getElementById? document.getElementById("digitalclock") : document.all.digitalclock
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var dn="AM"

if (hours==12) dn="PM"
if (hours>12){
dn="PM"
hours=hours-12
}
if (hours==0) hours=12
if (hours.toString().length==1)
hours="0"+hours
if (minutes<=9)
minutes="0"+minutes

if (standardbrowser){
if (alternate==0)
document.tick.tock.value=hours+" : "+minutes+" "+dn
else
document.tick.tock.value=hours+" "+minutes+" "+dn
}
else{
if (alternate==0)
clockobj.innerHTML=hours+"<font color='lime'>&nbsp;:&nbsp;</font>"+minutes+" "+"<sup style='font-size:1px'>"+dn+"</sup>"
else
clockobj.innerHTML=hours+"<font color='black'>&nbsp;:&nbsp;</font>"+minutes+" "+"<sup style='font-size:1px'>"+dn+"</sup>"
}
alternate=(alternate==0)? 1 : 0
setTimeout("show()",1000)
}
window.onload=show

//-->
</script>


Hope this helps.

dovidshmuel
03-20-2009, 04:54 AM
Thank you very much. I'm very new at this, so can you tell me how I go about putting it on a certain spot in my page? I've never done it before.
Thanks.

dovidshmuel
03-21-2009, 07:41 PM
Can someone tell me how I can alter the script so that the clock shows just one constant, fixed time of 20:20, but still have the ":" blinking, instead of telling the time?