You basically will need an understanding of the Date() object in the JavaScript model.
Some methods:
getDate() - day of the month
getDay() - day of the week
getHours() - hour (0-23)
getMinutes() - minutes
getSeconds() - seconds
getMonth() - month (0-11)
getYear() - year
getTime() - time in full format
To produce today's date:
var today_date= new Date()
var myyear=today_date.getYear()
var mymonth=today_date.getMonth()+1
var mytoday=today_date.getDate()
document.write("Today's date is: ")
document.write(myyear+"-"+mymonth+"-"+mytoday)