Senocular: countdown

Hey… I want to add years. I had no problem adding years to the basic script that was similiar to this I found on flashkit. What am I doing wrong here?


	this.secs = Math.floor(this.msecs/1000); // 1000 milliseconds make a second
	this.mins = Math.floor(this.secs/60); // 60 seconds make a minute
	this.hours = Math.floor(this.mins/60); // 60 minutes make a hour
	this.days = Math.floor(this.hours/24); // 24 hours make a second
**this.years = Math.floor(this.days/365.242199); // 365 days make a year**


	this.msecs = string(this.msecs % 1000);
	this.secs = string(this.secs % 60);
	this.mins = string(this.mins % 60);
	this.hours = string(this.hours % 24);
	this.days = string(this.days);
**this.years = string(this.years);**


	while (this.msecs.length < 3) this.msecs = "0" + this.msecs;
	if (this.secs.length < 2) this.secs = "0" + this.secs;
	if (this.mins.length < 2) this.mins = "0" + this.mins;
	if (this.hours.length < 2) this.hours = "0" + this.hours;
	while (this.days.length < 3) this.days = "0" + this.days;
**if (this.years.length < 1) this.years = "0" + this.years;**

As you can see, bold is what I added

p.s. “this.days = Math.floor(this.hours/24); // 24 hours make a second”

Did you mean make a day? hehe

HAH!

What a fool am I… I had the date set on thisyear(2004), thats why years kept showing up as zero… o’well :slight_smile: