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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:27:58+00:00 2026-06-03T09:27:58+00:00

As the title says I’m facing a problem displaying the right left time to

  • 0

As the title says I’m facing a problem displaying the right left time to an end date.

I’m using this jquery plugin: http://keith-wood.name/countdown.html

Let’s assume that our timestamp is generated by a PHP script like this: $end_date = strtotime($row4['end']); // 2012-05-09 06:00:00 becomes 1336536000

I use this ($i is used inside a loop):

$('.count-<?php echo $i; ?>').countdown({until: new Date(<?php echo $end_date; ?> * 1000), layout: '{dn} days {hnn} hrs {mnn} min {snn} sec', compact: true});

Right now it’s 06:21 AM here. Instead of the expected 1 day left result I get “1 days 17 hrs 04 min 21 sec”.

What am I missing here?

  • 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-03T09:28:00+00:00Added an answer on June 3, 2026 at 9:28 am

    I have been using the API for quite a while now, but I cann’t seem to figure out what’s up with your code. Perhaps (but just perhaps) you’re using the untill property wrong.

    My code that I usually use:

    $(function(){
        var countdown = $('#countdown'),
            ts = new Date(<?php echo $date_to * 1000; ?>),
            finished = true;
    
        if((new Date()) > ts)
        {
            finished = false;
        }
    
        $('#cool-countdown').countdown({
            timestamp   : ts,
            callback    : function(days, hours, minutes, seconds)
            {
                var message = "";
    
                message += days + " days, ";
                message += hours + " hours, ";
                message += minutes + " minutes, ";
                message += seconds + " seconds ";
    
                message = (finished ? "Countdown finished" : "left untill the New Year");
    
                countdown.html(message);
            }
        });
    
    });
    

    Obviously you should extend this to feature singular.

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

Sidebar

Related Questions

Title says mainly the problem. On my spare time for our group at school,
The title says everything. I'm using Visual Studio Team System 2008 Database Edition and
As the title says, I'm trying to do something like this: public abstract class
As title says, is there any way to pull something like this up?: std::set<boost::shared_ptr<MyClass>>
As title says, mock code to demostrate my problem Driver Class import java.io.*; public
So as the title says I want to get a value of this site
As title says, this issue happens in MS Access 2003 SP1. Does anyone know
The title says everything. I am talking about C/C++ specifically, because both consider this
Title says all. I'll have navigation that looks like this and it's dynamically created
Title says all. Sample code: ArrayList<HashMap<String, Object>> data = new ArrayList<HashMap<String, Object>>(); HashMap<String, Object>

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.