/    Sign up×
Community /Pin to ProfileBookmark

countdown to 9:00PM everyday

Hi I was wondering if anyone could help me out.. I want a script that will coutdown how many hours,minutes and seconds are left until 9:00PM every day. It’s for a website that closes everyday @ 9:00PM, so I want to put on the top of the page. You have 00:00:00 until the site closes… or something like that and i want to keep it as simple as I can, no big fancy blocks, plain text coutdown or text box is more than enough…

you can e-mail me @ [email][email protected][/email]

Thanks to whoever can help me!

to post a comment
JavaScript

16 Comments(s)

Copy linkTweet thisAlerts:
@7studNov 13.2004 — Hi,

i want to keep it as simple as I can, no big fancy blocks, plain text coutdown or text box is more than enough...

you can e-mail me @ [email][email protected][/email][/quote]



You can pm me to arrange contract work. ?
Copy linkTweet thisAlerts:
@JuuitchanNov 14.2004 — Don't even think about paying real money for it, djvicious!! This is too simple to be worth paying for.

First of all, what kind of site is this? Can it handle PHP scripts? (Check to see if your Web hosting service can handle PHP scripts for you.) If it can, I'll see what I can do to help. If not, I'll still try to help, but it won't come out as good.

Second -- and this is very important -- what time zone are you in?

Third, what time of day should I *begin* to display the countdown?
Copy linkTweet thisAlerts:
@senshiNov 14.2004 — well most logical.... 9pm seems to be the count down to so its the obvious start point.
Copy linkTweet thisAlerts:
@djviciousauthorNov 14.2004 — first off I know this is simple for someone who knows what they're doing and I wouldn't have paid for it! Second thank you very much for your help and now to answer your questions, the whole site is php based, so yes the server supports PHP, second the start point should be 9:00PM and I'm in the Eastern time zone -0500. The website it's for is www.montrealguestlist.com. Thank you very much again for your help!
Copy linkTweet thisAlerts:
@djviciousauthorNov 14.2004 — actually the best thing would be for the countdown could to start @ 12:00AM and finish @ 9:00PM and then stop between 9:00PM and 12:00AM

Thanks again!
Copy linkTweet thisAlerts:
@JuuitchanNov 14.2004 — <i>
</i>&lt;?php echo (strtotime("now")-strtotime("21:00")) ?&gt;


I think that the above line of PHP is self-explanatory. I've never tried it, though, so I don't know if the "21:00" is your local time or not.

You can use it in a countdown script as follows:

<center><div id="countdown"> </div></center>

<script language="JavaScript">

var timeleft=<?php echo (strtotime("now")-strtotime("21:00")) ?>;

function tick() {

if (timeleft<0) timeleft=0;

timestring=(timeleft/3600+100).toString().substring(1,3)

+":"+(((timeleft/60)%60)+100).toString().substring(1,3)

+":"+((timeleft%60)+100).toString().substring(1,3);

document.all.countdown.innerHTML='Time Left: '+timestring;

if (timeleft<=0) return 0;

setTimeout('timeleft=tick()',1500-((new Date())%1000));

return timeleft-1;

}

timeleft=tick();

</script>
Copy linkTweet thisAlerts:
@djviciousauthorNov 14.2004 — how do i implement this in the page?

i made a countdown htm file which i put on the server, and the page came up blank.
Copy linkTweet thisAlerts:
@JuuitchanNov 14.2004 — You are trying to use php.

You need to put the code in a php file. You could, for example, name it "countdown.php".
Copy linkTweet thisAlerts:
@djviciousauthorNov 15.2004 — i made a php page from the code, put in on the server and it still didn't work, what would i have to do if i wanted a page to only disply this:

"You have(insert countdown time here)left to get on the guestlist!"

That's it, how would i put that code in a page so i could see the above result?
Copy linkTweet thisAlerts:
@7studNov 15.2004 — Don't even think about paying real money for it, djvicious!! This is too simple to be worth paying for.[/quote]
?
Copy linkTweet thisAlerts:
@JuuitchanNov 15.2004 — See if it works now. I fixed a typo.
Copy linkTweet thisAlerts:
@djviciousauthorNov 15.2004 — nope... still nothing
Copy linkTweet thisAlerts:
@JuuitchanNov 15.2004 — Okay. Let's see if the PHP is working. For now, put only this on the page:
<i>
</i>&lt;?php echo (strtotime("now")-strtotime("21:00")) ?&gt; seconds left


For some reason, my JavaScript isn't working. Anyone else here who can make it work?
Copy linkTweet thisAlerts:
@7studNov 16.2004 — :p
Copy linkTweet thisAlerts:
@djviciousauthorNov 16.2004 — 7stud: what's up with all the faces? u gonna help us out or what? ;-)
Copy linkTweet thisAlerts:
@JuuitchanNov 16.2004 — Yes. We don't need you faking us out with those bloody smileys. Only post if you have something worthwhile to contribute.

djvicious, I still don't have the results of that last test I asked about....
×

Success!

Help @djvicious 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.19,
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,
)...