step five(b):

If however you want to leave the months as numbers, instead of that massive load of if statements, simply write this code:

month = month + 1;


We add one to the month again because January is zero etc. For this we dont need the "day" variable because it tells you how far into the week you are...Not really what you usually see in a numbers-only date.

step five(c):
>> to make the minutes and seconds display correctly, we again use an if statement.

if (minutes<10) {
        minutes = "0"+minutes;
}
if (seconds<10) {
        seconds = "0"+seconds;
}


This is slightly more complex. It says to the program, "If the value of minutes is less than 10, then add a zero on the front". This is a slighly odd type of adding - its the type where if you add 5 and 3 you get 53, not 8. That works because the 0 we add on is in speech marks "" so that makes it a string. For more info see the Variables 101 tutorial (linked below in "Related Articles").

step six:
To change the time from 24 hour to 12 hour, we use this code (if you want it on 24 hour time then just skip this):

if (hours>12 ) {
        hours = hours-12;
        ampm = "PM";
} else if (hours == 12) {
        ampm = "PM";
} else {
        ampm = "AM";
}
if (hours == 0) {
        hours = 12;
}


What this does is say to the program, "If the value of hours is over 12, then subtract 12 from it" and then change the status of the am/pm indicator to PM.
It then counters for the fact that if the hours is actually 12 and it becomes 0, it changes the hours to 12 so midnight doesn't become 0AM.

step seven:
Here's where it gets interesting. This is where we put together what will go into the text boxes.
Use this code to put together the time (12 hours):

time = ((hours) + ":" + (minutes) + ":" + (seconds) + " " + (ampm));


Or this code to put together the time (24 hours):

time = ((hours) + ":" + (minutes) + ":" + (seconds));


Basically what this does is put together a string of the time - so you get the hours, then a ":" then the minutes and so on.
use this code to put together the date (with names):

datefinal = ((day) + " " + (date) + " " + (month) + " " + (year));


Same concept basically, you get the day then it puts a space in then the date etc
Use this code to put together the date (using numbers only, if you use this remember to perform step five(b) and not (a)):

datefinal = ((date) + "/" + (month) + "/" + (year));


Same concept, please note that this is in australian date format, to make it american simply switch around the "date" and "month" variables.
Thats it! Just hit ctrl/apple + enter to test your movie.

*This how the clock updates itself. Instead of doing anything big and complex the way this works is it runs 12 times every second (or however fast the framerate of the movie is set to) and every time it gets to frame 1 it checks the system clock again. This means that when the seconds change it will "catch" it and change itself.