# Problem with displaying the time

**URL:** <https://forum.kirupa.com/t/problem-with-displaying-the-time/215592>\
**Category:** flash\
**Created:** [February 8, 2007, 2:16pm UTC](https://forum.kirupa.com/t/problem-with-displaying-the-time/215592 "2007-02-08T14:16:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![skepticstudios](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@skepticstudios](https://forum.kirupa.com/u/skepticstudios)\
**Post date:** [February 8, 2007, 2:16pm UTC](https://forum.kirupa.com/t/problem-with-displaying-the-time/215592/1 "2007-02-08T14:16:19Z")

</div>

Hi folks, need a bit of help with regards to showing the time in Flash, the movie I’m making looks like a news broadcast and I am going to be displaying the time (hours and minutes) in two separate dynamic text boxes named ch and cm. The problem that I am having is that when, for example the time is 5 past 2, the time displays as 14: 5, rather than 14:05 so the zero is missing, any ideas?

My code is this:

```auto
var dt, timeint; 

dt = new Date(); 
ch = dt.getHours();     
cm = dt.getMinutes(); 
cs = dt.getSeconds(); 
timeint=setInterval(timer,1000); 

function timer() { 
dt = new Date(); 
ch = dt.getHours();
cm = dt.getMinutes();
cs = dt.getSeconds(); 
}

```
