# Countdown help

**URL:** <https://forum.kirupa.com/t/countdown-help/225459>\
**Category:** Uncategorized\
**Created:** [May 12, 2007, 12:28am UTC](https://forum.kirupa.com/t/countdown-help/225459 "2007-05-12T00:28:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjradio](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@sjradio](https://forum.kirupa.com/u/sjradio)\
**Post date:** [May 12, 2007, 12:28am UTC](https://forum.kirupa.com/t/countdown-help/225459/1 "2007-05-12T00:28:29Z")

</div>

Hello, I am really a beginner at Flash and am looking for any help you could offer.

I have found a script and I have been trying to figure out how to modify it to not only have it count down to a specific date, but a specific time as well.

What do I need to change in this actionscript script to have it countdown to 7:30 PM on the date listed. (August 24, 2007)

> 

this.onEnterFrame = function() {

```
var today:Date = new Date ();
var currentYear = today.getFullYear();
var currentTime = today.getTime();

var targetDate:Date = new Date(currentYear,7,24);
var targetTime = targetDate.getTime();

var timeLeft = targetTime - currentTime;
var sec = Math.floor(timeLeft/1000);
var min = Math.floor(sec/60);
var hrs = Math.floor(min/60);
var days = Math.floor(hrs/24);
sec = string(sec % 60);
if (sec.length &lt; 2) {
    sec = "0" + sec;
}
min = string(min % 60);
if (min.length &lt; 2) {
    min = "0" + min;
}
hrs = string(hrs % 24);
if (hrs.length &lt; 2) {
    hrs = "0" + hrs;
}
days = string(days);

var counter:String = days + ":" + hrs + ":" + min + ":" + sec
time_txt.text = counter;

```

}
