/    Sign up×
Community /Pin to ProfileBookmark

Timer that Resets every 36 hours, starting from a certain day/time

Hey guys, i’m a complete idiot and have no idea how to do this but what I need is simple.

I need a script that will start at a certain time and day, and then repeat counting down in 36 hour increments.

this is what I have:

<html>
<body>
<center>
<a href=”http://s260.photobucket.com/albums/ii17/zynner/?action=view&current=Aetherite_Icon.png” target=”_blank”><img src=”http://i260.photobucket.com/albums/ii17/zynner/Aetherite_Icon.png” border=”0″ alt=”Aetherite”></a>
<sup><big><b>Guildleves Will Reset In:
<script type = “text/javascript”>

dateFuture = new Date(2010,9,5,2,47,00);

function GetCount(){

dateNow = new Date();
amount = dateFuture.getTime() – dateNow.getTime();
delete dateNow;

if(amount < 0){
document.getElementById(‘countbox’).innerHTML=”Now!”;
}

else{
days=0;hours=0;mins=0;secs=0;out=””;

amount = Math.floor(amount/1000);

days=Math.floor(amount/86400);
amount=amount%86400;

hours=Math.floor(amount/3600);
amount=amount%3600;

mins=Math.floor(amount/60);
amount=amount%60;

secs=Math.floor(amount);

if(days != 0){out += days +” day”+((days!=1)?”s”:””)+”, “;}
if(days != 0 || hours != 0){out += hours +” hour”+((hours!=1)?”s”:””)+”, “;}
if(days != 0 || hours != 0 || mins != 0){out += mins +” minute”+((mins!=1)?”s”:””)+”, “;}
out += secs +” seconds”;
document.getElementById(‘countbox’).innerHTML=out;

setTimeout(“GetCount()”, 1000);
}

}

window.onload=GetCount;
startTimer(129600);

</script>

<div id=”countbox”></div>

</sup>
</body>
</html>

essentially, what I want is the timer to display how much time is left until the next guildleve starts. Starting on a certain time/day. The leves repeat every 36 hours. All I need is for this script to start over again at 36, and count down to 0. Rinse/repeat. Starting on a day I specify.

Any help would be much appreciated.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @jscriptidiot spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...