hi
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
All this is doing is pulling the date from your local computer (little clock in the bottom right corner (on xp). And storing the hours, mins and seconds in variables.
the rest of the script is a bit usless and just makes it look complicated. All it does is add 0's and stuff.
This is quite simple javascript, so if you are just hopping, trying to grasp the language, i would suggest to start at the beggining and go slowly making sure you understand peices before moving on.
Reece