Need Date and Time Help

How do i make the date and time if its less than 10 to display a zero in front so for example like four o six and and six seconds looks like this 04:06:06 instead of this 4:6:6. also how do you do this with a date i want a date have only 2 digits for the year and if the month and day are less than 10 to display a zero in front of them…

Create a movie clip with 3 textfields inside and set their variables as:
myhours
myminutes
myseconds

Now place the folllowing actions on the movie clip:[AS]onClipEvent (enterFrame) {
myDate = new Date();
hours = myDate.getHours();
minutes = myDate.getMinutes();
seconds = myDate.getSeconds();
myhours = hours;
myminutes = minutes;
myseconds = seconds;
(hours<10) ? myhours=“0”+hours : myhours=hours;
(minutes<10) ? myminutes=“0”+minutes : myminutes=minutes;
(seconds<10) ? myseconds=“0”+seconds : myseconds=seconds;
}[/AS]

hmm, this could be compacted to this:

onClipEvent (enterFrame) {
        var myDate = new Date();
        var hours = myDate.getHours();
        var minutes = myDate.getMinutes();
        var seconds = myDate.getSeconds();
        myhours = (hours<10) ? "0"+hours : hours;
        myminutes = (minutes<10) ? "0"+minutes : minutes;
        myseconds = (seconds<10) ? "0"+seconds : seconds;
}

Awesome… thanks

welcome :slight_smile: