Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

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
?
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
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)
Suggested Courses

721 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