Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

can someone please advise how to create a jquery countdown and place result in array

Posted on 2012-04-11
2
Medium Priority
?
218 Views
Last Modified: 2012-04-15
I am working on a countdown clock to add to my site.

I need to find how many days until 5th May 1980 then cut up the numbers into an array.

Can someone please advise or provide sample code for the best way to do this using Jquery.
0
Comment
Question by:jecommera
2 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 37837412
try this :
var arr = [];
var j = 0;
for(var i=new Date().getTime();i>new Date(1980,4,5).getTime();i -= (24*3600 * 1000)) arr.push(j++);

Open in new window

0
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 2000 total points
ID: 37839780
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question