Solved

millisecond countdown timer

Posted on 2012-04-11
3
1,742 Views
Last Modified: 2012-04-25
I'm trying to create a timer that counts down in years, months, days, hours, minutes, seconds and milliseconds. I've found a few guides online, but they are sort of not easy to understand, or do not do the milliseconds. Can anyone help me do something like this, say, for this friday at 13:30.

so it could read 0y 0m 2d 2h 11m 50ms

and counts down the milliseconds. I would show code to demonstrate that I have actually tried to do this myself, but it all failed so dismally that i'd be embarrassed to.

Thanks for any help!
0
Comment
Question by:hibbsusan
[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
3 Comments
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37834333
download the sample code from here and make the changes to include year, month and milliseconds....

http://www.hashemian.com/tools/javascript-countdown.htm
0
 

Author Comment

by:hibbsusan
ID: 37834496
Right. I couldn't figure out how to make this one display milliseconds -

Thanks!
0
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 500 total points
ID: 37834577
First Download this js file:-
http://scripts.hashemian.com/js/countdown.js

Next modify the DisplayFormat variable as:-
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds, %%MS%% MilliSeconds.";

Next in coutback method add this line for milliseconds:-
DisplayStr = DisplayStr.replace(/%%MS%%/g, calcage(secs*1000,1,1000));

i hope you will make rest of the changes now...
0

Featured Post

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This video teaches users how to migrate an existing Wordpress website to a new domain.

691 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