Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

millisecond countdown timer

Posted on 2012-04-11
3
Medium Priority
?
1,913 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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

618 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