# Countdown Timer Code

**URL:** <https://forum.kirupa.com/t/countdown-timer-code/294119>\
**Category:** flash\
**Created:** [August 8, 2009, 9:33pm UTC](https://forum.kirupa.com/t/countdown-timer-code/294119 "2009-08-08T21:33:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![safinn](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@safinn](https://forum.kirupa.com/u/safinn)\
**Post date:** [August 8, 2009, 9:33pm UTC](https://forum.kirupa.com/t/countdown-timer-code/294119/1 "2009-08-08T21:33:15Z")

</div>

This is the code im using:

```auto
this.onEnterFrame = function() { var today:Date = new Data();	var currentYear = today.getFullYear();	var currentTime = today.getTime(); var targetDate:Date = new Date(currentYear,10,11); 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 < 2) { sec = "0" + sec;	}	min = string(min % 60);	if (min.length < 2) { min = "0" + min;	}	hrs = string(hrs % 24); if (hrs.length < 2) { hrs = "0" + hrs;	}	days = string(days); var counter:String = days + ":" + hrs + ":" + min + ":" sec;	time_txt.text = counter; }

```

and I get this error:Description: 1086: Syntax error: expecting semicolon before sec. Source: var counter:String = days + “:” + hrs + “:” + min + “:” sec;What am I doing wrong? Is the code wrong?Thanks for the help!
