# Countdown timer to every thursday

**URL:** <https://forum.kirupa.com/t/countdown-timer-to-every-thursday/218189>\
**Category:** Uncategorized\
**Created:** [March 5, 2007, 8:14pm UTC](https://forum.kirupa.com/t/countdown-timer-to-every-thursday/218189 "2007-03-05T20:14:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LordCalvert](https://avatars.discourse-cdn.com/v4/letter/l/9f8e36/32.png) [@LordCalvert](https://forum.kirupa.com/u/LordCalvert)\
**Post date:** [March 5, 2007, 8:14pm UTC](https://forum.kirupa.com/t/countdown-timer-to-every-thursday/218189/1 "2007-03-05T20:14:07Z")

</div>

Hello guys!

This is my first post here on Kirupa, and I hope you can help me with this problem.  
I’ve searched the forum but I couldn’t find any thread that helped me.

Ok, so I used this [tutorial](http://www.kirupa.com/developer/mx/countdown.htm) to make a counter. It worked perfectly but, I need it to count down to every thursday at 18:00 (6 pm), display frame 2 until friday 00:00 and then start to count down to next thursday again.

Here’s the code:

stop();  
currentDate = new Date();  
thisYear = currentDate.getFullYear();  
eventDate = new Date(thisYear, 2, 8, 18);  
eventMillisecs = eventDate.getTime();  
counter.onEnterFrame = function(){  
currentDate = new Date();  
currentMillisecs = currentDate.getTime();

this.msecs = eventMillisecs - currentMillisecs;

if (this.msecs \<= 0){  
play();  
return;  
}

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.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);

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;  
for(movie in this){  
if (this[movie].\_parent == this) this[movie].evaluateFrameFrom(this);  
}  
};  
MovieClip.prototype.evaluateFrameFrom = function(variableClip){  
var nameArray = this._name.split("_");  
var numberSet = variableClip[nameArray[0]];  
var character = number(nameArray[1]);  
var frame = 1 + number(numberSet.charAt(character));  
if (this.\_currentframe != frame) this.gotoAndStop(frame);  
};

Anyone know how to solve this? It would be most appriciated! 🙂
