Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula to Calculate Milliseconds?? 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm creating a count down timer to a specific date, and I have the hour, min, secs and days calculated but I just can't get the formula for milliseconds. Can someone please help. Thanks
 
You want to display milliseconds? Isn't the whole date in milliseconds in the first place? Regards,

oldman3.gif
 
No, I'm producing a count down timer to a specific date.


So let's say I'm counting down to December 24, 2002

I'm displaying the days, hours, minutes, seconds and milliseconds. I would like to know if anyone knows the formula to calculate milliseconds. For example the formula to calculate days is
varDays = (endDate - current)/1000/60/60/24 Thanks

varMilli = ??????????
 
If

varDays = (endDate - current)/1000/60/60/24

is days then surely (endDate-current) is milliseconds?

What you're doing is dividing by 1000 to get seconds, then 60 to get minutes then 60 again to get hours and then by 24 to get days...

 
Yeah, but it was so important I decided to stress it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top