Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

148
Views
JS daily countdown timer UTC +1

Good morning,

I'm trying to put on my website a timer, that reset evey day at 00:00 UTC +1 (Rome), and start again. The fact is that is more complex than this... The timer need to start at 00:00. On the website, ppl will see 23:00:00 remaining. For the one hour remaining until 00:00, so from 23:00 until 00:00, on the website ppl will see "Results will be published within one hour, the game will restart in "countdown one hour"" and at 00:00 everything will resset.

the JS code that I have from my template is:

    if (plugins.countDown.length) {
        var d;
        for (i = 0; i < plugins.countDown.length; i++) {

            var countDownItem = plugins.countDown[i],
                    d = new Date(),
                    time = countDownItem.getAttribute('data-time'),
                    type = countDownItem.getAttribute('data-type'), // {until | since}
                    format = countDownItem.getAttribute('data-format') ? countDownItem.getAttribute('data-format') : 'YYYY/MM/DD hh:mm:ss',
                    expiryText = countDownItem.getAttribute('data-expiry-text') ? countDownItem.getAttribute('data-expiry-text') : 'Countdown finished',
                    labels = countDownItem.getAttribute('data-labels') ? countDownItem.getAttribute('data-labels') : '',
                    layout = countDownItem.getAttribute('data-layout') ? countDownItem.getAttribute('data-layout') : '{yn} {yl} {on} {ol} {dn} {dl} {hnn}{sep}{mnn}{sep}{snn}',
                    settings = [];


            if (labels.length > 0) {
                settings['labels'] = JSON.parse(labels);
            }

            d.setTime(Date.parse(time)).toLocaleString();
            settings[type] = d;
            settings['expiryText'] = expiryText;
            settings['format'] = format;
            settings['alwaysExpire'] = true;
            settings['padZeroes'] = true;
            settings['layout'] = layout;
            settings['onExpiry'] = function () {
                this.classList += ' countdown-expired';
                this.innerHtml = expiryText;
            };

            $(countDownItem).countdown(settings);
        }
    }

just a simple count down.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!