# Time Display problem

**URL:** <https://forum.kirupa.com/t/time-display-problem/182354>\
**Category:** flash\
**Created:** [March 17, 2006, 11:37am UTC](https://forum.kirupa.com/t/time-display-problem/182354 "2006-03-17T11:37:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edenbridge](https://avatars.discourse-cdn.com/v4/letter/e/97f17d/32.png) [@Edenbridge](https://forum.kirupa.com/u/Edenbridge)\
**Post date:** [March 17, 2006, 11:37am UTC](https://forum.kirupa.com/t/time-display-problem/182354/1 "2006-03-17T11:37:00Z")

</div>

hello there. I have to make time so the hours to be starting with 0 for the numbers less then 10 for example 9:30 to be 09:30 and in my code it works for the minutes but not for the hours :(. Where am I wrong in the code?  
I have written the following code here:

function UpdateClock () {  
myDate = new Date ()  
hours = Number(myDate.getHours())  
minutes = Number(myDate.getMinutes())  
seconds = Number(myDate.getSeconds())  
paris=hours-1;  
london=hours-2;  
newYork=hours-8;  
Tokyo=hours-5;  
if(hours\<10){ hours=“0”+hours; return hours; }  
if(minutes\<10){ minutes=“0”+minutes; return hours; }  
}
