METHODS OF THE DATE OBJECT
The Date object includes many methods that allow you to both get (read) and set (write) each field of a date, and extract a specific field from the Date object. Important ones include:
Date.getDate()
// day of the month
Date.getMonth()
// month (numeric value, starting with 0 for January)
Date.getDay()
// day of the week (numeric value, starting with 0 for Sunday)
Date.getFullYear()
// four-digit year
Date.getHours()
// hours since midnight
Date.getMinutes()
// minutes
Date.getSeconds()
// seconds
Date.getMilliseconds()
// milliseconds
Date.getTime()
// number of milliseconds since the epoch
There are also methods to set all these, for
example setDate(). The only exception is getDay() -- because day
of the week is set by the other parameters of the date, there's no
setDay() method.
