The Date object is used to work with dates and times. Examples Date Returns today's date including date, month, and year. So add 1 to the getMonth method to display the correct date.
Time Returns the current local time including hour, minutes, and seconds.
To return the GMT time use getUTCHours, getUTCMinutes etc. Set date You can also set the date or time into the date object, with the setDate, setHour etc. Note that in this example, only the FullYear is set. The getUTCDate method returns the Universal Coordinated Time which is the time set by the World Time Standard. Display weekday A simple script that allows you to write the name of the current day instead of the number.