and I have created two functions to help me out.
The main function takes a date object and a format string and returns a formatted date.
It is VERY basic at the moment but it works.
The format string should be supplied in standard date format, in any order with any delimiters.
dd for Date of the month
MM for month
yy or yyyy for Year
hh for hours
mm for minutes
ss for seconds
e.g. dd/MM/yy hh:mm:ss
The function above uses my addZero function which takes a number converts it to a string and if it is less than 10 adds a "0" in front of it. i.e. 1 returns 01, 2 returns 02 etc.