Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8559999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:10:46+00:00 2026-06-11T16:10:46+00:00

I have the script needed to generate a countdown timer that has a start

  • 0

I have the script needed to generate a countdown timer that has a start and resume button. What I’m attempting to do is to have Start, stop, and reset buttons on one page that controls the timer on the other page.
So if user X visits page.html they will see a timer that is at 0.
Admin X visits admin.html where they see the timer at 0 but they also have a start, stop, and reset buttons. When the Admin clicks a button, the timer on page.html starts to countdown. If another user visits the page while the timer is counting down, they will see where the timer currently is at. If anyone has any code ideas, other answers on this site I can reference, or the code that I would need, I would be very thankful.

—The real scenario
We have people on skype that are doing a show and they need to know when it’s time to take a break. The idea is that the producer can hit a button that starts a countdown timer to let them know they have 60 seconds till a break. The reason I want this on a web page is because there are other things going on in the page that the person on skype is paying attention to. So I wanted something that they can’t miss. I have access to an sql server, and can do both php and javascript. I’m guessing I will need to do some kind of combination of the two.

UPDATE Thanks everyone for your help.

I’m updating this because I’ve realized that I’m probably making things more complicated than they need to be at this point.
There is a break every 30 min and all shows will either start at the top of an hour or at 30min past. I finally figured out the perfect script. Although it may be slightly off because of normal clock drift, it should actually display the same no matter who enters the page.

<script>
 function addZero(i)
{
if (i<10)
  {
   i="0" + i;
  }
 return i;
 }
 setInterval(function() {
   function addZero(i)
{
if (i<10)
  {
  i="0" + i;
  }
return i;
}
    var d = new Date();
    var s =(d.getSeconds());
    var m =(d.getMinutes());
    var x = document.getElementById("timer");
    var c = addZero(30 - m) + ":" + addZero(60 - s);
    var d = addZero(60 - m) + ":" + addZero(60 - s);
    if (m < 30) {
        t = c
    }
    else {
        t = d
    }

     x.innerHTML = t;
 }, 250) 
    </script>    
 <div align="center">
    <table><tbody>
    <tr><td style="font-size:34px;" id="timer"></td>
    <td nowrap="nowrap" width="15px"><p style="text-align: left;"></p></td>
    <td style="font-size:24px;">Minutes till Station Break.</td></tr>
     </tbody></table>
          </div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:10:47+00:00Added an answer on June 11, 2026 at 4:10 pm

    I have finally come up with a solution that works. There are still elements I haven’t quite figured out how to fix, but the following code essentially does exactly what I need for now.

    setInterval(function() {
    function addZero(i) {
        if (i < 10) {
            i = "0" + i;
        }
        return i;
    }
    var x = document.getElementById("timer");
    var d = new Date();
    var s = (d.getSeconds());
    var m = (d.getMinutes());
    var a = addZero(30 - m);
    var b = addZero(60 - m);
    var c = (60 - s);
    var z = "<span style='color:red;font-size:50px;'>" + "Break" + "</span>";
    var v = "<span style='color:black;font-size:24px;'>" + "Break" + "</span>";
    
    if (m > 30) {
        y = b;
    }
    else if (m < 30) {
        y = a;
    }
    if (y < 2 && c < 15) {
        q = z;
    }
    else {
        q = v;
    }
    
    var t = y + (":" + addZero(c) + " Till Station " + (q));
    x.innerHTML = t;
    }, 250);
    
    
    
    <div align="center" id="timer" style='color:black;font-size:24px;' ></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an script interpreter that is spawn by a deamon and has to
I have a PHP script that will generate <input> s dynamically, so I was
I have a script that generate me some command that I must execute... Example:
I have script that reads remote file content and writes it to local server.
I need to have script.sh , that would create files f1.txt and f2.txt with
I have this script that run to fix my menu bar to the browser
I have a script that recursively loops through all the sub directories and compresses
I have a script that takes lots of content and builds 1000s of MovieClips
I have a script that is run over a network, with VPN being the
I have an app that uses some code scripts to generate dll's at run-time

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.