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

  • Home
  • SEARCH
  • 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 6708829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:48:25+00:00 2026-05-26T07:48:25+00:00

I am using javascript for a count down timer <script type=text/javascript> $(function() { var

  • 0

I am using javascript for a count down timer

<script type="text/javascript">
        $(function() {
        var newYear = $(".HF").val();
            alert('hehe' + newYear);
            $('#countdown').countdown({ until:newYear, format: 'DHMS', layout:
'<div id="timer">' + '<hr />' +
    '<div id="timer_days" class="timer_numbers">{dnn}</div>' +
    '<div id="timer_hours" class="timer_numbers">{hnn}</div>' +
    '<div id="timer_mins" class="timer_numbers">{mnn}</div>' +
    '<div id="timer_seconds" class="timer_numbers">{snn}</div>' +
'<div id="timer_labels">' +
    '<div id="timer_days_label" class="timer_labels">days</div>' +
    '<div id="timer_hours_label" class="timer_labels">hours</div>' +
    '<div id="timer_mins_label" class="timer_labels">mins</div>' +
    '<div id="timer_seconds_label" class="timer_labels">secs</div>' +
'</div>' +
'</div>'
            });
        });
</script>

it gets its until value from a hidden field HF.The value of the hidden field is a string 10/22/2011…but the timer shows only 34 mins left while it must show 2 days and some hours and some mins left..why??

  • 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-26T07:48:25+00:00Added an answer on May 26, 2026 at 7:48 am

    The newYear string has to be converted to a Date object:

    var newYear = $(".HF").val();
    newYear = new Date(newYear); // 10/22/2011 > Dat object of 22 Okt 2011
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using javascript to get the value of a hiddenfield <script type=text/javascript> $(function()
I am using the following code to countdown before enabling a button. <script type=text/javascript>
I am using http://nithinbekal.com/2009/javascript-how-to-create-a-simple-countdown-timer/ But when I run it in firefox I get the
I tried using this JavaScript countdown timer on my page but the timer won't
Right now I am using this Javascript timezone timer: http://www.hashemian.com/tools/javascript-countdown.htm This works but it
I am trying to create a countdown using javascript. I got some code from
using Javascript, it is easy to programatically select the text inside a textarea or
I'm using JavaScript to hide an image and show some text thats hidden under
I found the count down script in http://www.dynamicdrive.com/dynamicindex6/dhtmlcount.htm It works fine if i just
I'm trying to make a countdown timer using JS, obviously. I think my code

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.