Jump to content

countdown + 5 hours


robert.access

Recommended Posts

hi! please somebody help me to set this to display + 5 hours in this script:

 

<span id="servertime"></span>

 

this is called from here (how to modify to display five hours ahead? Thanks):

 

<script type="text/javascript">

var currenttime = '<?=$current_time_display;?>';

var serverdate=new Date(currenttime);

 

function padlength(what){

var output=(what.toString().length==1)? "0"+what : what;

return output;

}

 

function displaytime(){

serverdate.setSeconds(serverdate.getSeconds()+1)

var timestring=padlength(serverdate.getHours())+":"+padlength(serverdate.getMinutes())+":"+padlength(serverdate.getSeconds());

document.getElementById("servertime").innerHTML=timestring;

}

 

window.onload=function(){

setInterval("displaytime()", 1000);

}

 

var ie4 = false;

if(document.all) { ie4 = true; }

 

function getObject(id) { if (ie4) { return document.all[id]; } else { return document.getElementById(id); } }

function toggle(link, divId) {

var lText = link.innerHTML;

var d = getObject(divId);

if (lText == '+') { link.innerHTML = '&#8211;'; d.style.display = 'block'; }

else { link.innerHTML = '+'; d.style.display = 'none'; }

}

 

</script>

Link to comment
https://forums.phpfreaks.com/topic/186720-countdown-5-hours/
Share on other sites

really don't know. It's a pre made script...

 

can you be more explicit please

 

Scripts usually always have some important info, in separate sections of the script, it seems you are only giving us bits at a time! maybe showing us the entire script would help.. and place the code between these tags:


to be more readable..

Link to comment
https://forums.phpfreaks.com/topic/186720-countdown-5-hours/#findComment-986066
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.