Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #31  
Old June 12th, 2008, 02:47 PM
Murdockx Murdockx is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Posts: 1 Murdockx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 16 sec
Reputation Power: 0
newbie to java here

i got days added in and found it simple enough

however i'm lost with adding centiseconds. i'm assuming of course that i would need to make centiseconds the new standard time in the code instead of seconds.

i read somewhere that java keeps track of time in milliseconds naturally. if this is true, would it be as easy as just simply revealing it in a specified place (for example; after seconds, obviously)
Code:
function SetCountdownText(seconds) {
	//store:
	_currentSeconds = seconds;
	
	//get minutes:
	var minutes=parseInt(seconds/60);
	
	//shrink:
	seconds = (seconds%60);
	
	//get hours:
	var hours=parseInt(minutes/60);
	
	//shrink:
	minutes = (minutes%60);
	
	//get days:
	var days=parseInt(hours/24);
	
	//shrink:
	hours = (hours%24);
	
	//build text:
	var strText = AddZero(days) + ":" + AddZero(hours) + ":" + AddZero(minutes) + ":" + AddZero(seconds);



EDIT: i figured out a way. i changed
window.setTimeout("CountDownTick()", 1000);
to
window.setTimeout("CountDownTick()", 1);

in both instances. then changed seconds, minutes, days, accordingly. seconds are now centiseconds, minutes are now seconds, and so on. putting in the time now is 3600 for 1 minute which kinda blows. if anyone knows of a more "correct" way of doing this, i would still appreciate it.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Javascript Countdown Timer


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway