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 7636703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:45:05+00:00 2026-05-31T07:45:05+00:00

I am newbie and need ur help. I have a problem on finding out

  • 0

I am newbie and need ur help. I have a problem on finding out days, hours, minutes and seconds. I dont know what to update minutes after seconds will reach 60 and same with hours and days.
I am trying to countdown to a given date in a format of Days/Hours/Minutes/Seconds.
Here is the link of what I’ve done so far.
Thnx in advance! 🙂

  • 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-05-31T07:45:06+00:00Added an answer on May 31, 2026 at 7:45 am

    I’ve modified your count_execution function and added some comments. It should do what you ask.

    function count_execution() {
      // target date of event
      var eventDate   = new Date(settings.date);
      // now
      var currentDate = new Date();
      // get date diff *in milliseconds*
      var diff   = Math.abs(currentDate - eventDate);
    
      // compute days left
      // 24h * 60m * 60s * 1000 = 86400000
      var days = Math.floor(diff / 86400000);
      diff = diff % 86400000;
    
      // compute hours left
      // 60m * 60s * 1000 = 3600000
      var hours = Math.floor(diff / 3600000);
      diff = diff % 3600000;
    
      // the same for minutes
      var minutes = Math.floor(diff / 60000);
      diff = diff % 60000;
    
     // finally, seconds
     var seconds = Math.floor(diff / 1000);
    
     $this.find('#days').text(days);
     $this.find('#hours').text(hours);
     $this.find('#mins').text(minutes);
     $this.find('#secs').text(seconds);
    }
    

    Hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

need help in some wired problem. I have a sqlite table items as following
I'm a newbie in Sharepoint 2010 and need some help. I have downloaded two
I have a newbie question. I need help on separating a text file into
Im a newbie programmer in Delphi. I need help, I have a small project
i need help with a little code that i have below. i'm a newbie
I am newbee with PHP and MySQL and need help... I have two tables
I am newbie to db programming and need help with optimizing this query: Given
Im a javascript newbie and would need some help with this simple thing... I
Please help to the newbie in WPF! I need to build a TreeView with
An XSLT-newbie problem: I need to substitute a text value in XML-file. All other

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.