Jump to content

Time and Date countdown - Desperate help!


Snooble

Recommended Posts

Thanks in advance!

 

I run a club night every Wednesday at 8pm, I want a countdown to the night on my website at all times. So if it's Tuesday "Get yourself ready for tomorrow!", if it's Monday "2 days, 4hours, 34minutes, 20seconds till we start".

 

Also, I'd like it to count down live.. so I guess I need to use javascript too?

 

Thanks so much, i'd be greatful for any help.

 

Snoobs

Link to comment
Share on other sites

You can use PHP with AJAX to update the time and keep track of it if need be. You can calculate the difference between the dates with the unix time stamp, as it is in seconds it'll be that much simpler in the long run.

 

If you're wanting more specific examples, give us a specific code you're having trouble with.

Link to comment
Share on other sites

Do you want a countdown timer that will actually count down in real-time or just a user visits or refreshes the page?

There is HEAPS of scripts out there for PHP that will do a countdown for you and you can just tweak it to have your little messages at certain times..

If you want a real-time counter you would use javascript which I would, personally have PHP pass the value to the JS and let JS take over from there..

Link to comment
Share on other sites

I would like to display how many days/hours/minutes left until 8pm Wednesday. Counting down in realtime.

Can I please have some sort of direction? What function do I use? How to I make it do this every week and not just for a single date. help help help.

 

Link to comment
Share on other sites

That sounds good to me.. but you can go 1 better if you want and make it countdown to the very last second with something like this.

if (todays_day == wednesday && time < 8pm) {
// set the javascript date to 8pm today
} else {
// get the next wednesday at 8pm
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.