• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Date Object

Date Object

Note

Universal Coordinated Time (UTC) is the same as Greenwich Mean Time.


Method Description Parameters
new Date(year , month , date , hour , min , sec , ms ) Creates a new Date object. year , month , date , hour , min , sec , ms , optional arguments for a specific date
getDate() Returns the date of the month (1-31). 
getDay() Returns the day of the week (0-6). 
getFullYear() Returns the four-digit year. 
getHours() Returns the hour of the day (0-23). 
getMilliseconds() Returns the millisecond (0-999). 
getMinutes() Returns the minute (0-59). 
getMonth() Returns the month (0-11). 
getSeconds() Returns the second (0-59). 
getTime() Returns the number of milliseconds elapsed since midnight, January 1, 1970 UTC. 
getTimezoneOffset() Returns the difference between the local time and UTC, in minutes. 
getUTCdate() Returns the date of the month (1-31), UTC. 
getUTCday() Returns the day of the week (0-6), UTC. 
getUTCFullYear() Returns the four-digit year, UTC. 
getUTCHours() Returns the hour of the day (0-23), UTC. 
getUTCMilliseconds() Returns the millisecond (0-999), UTC. 
getUTCMinutes() Returns the minute (0-59), UTC. 
getUTCMonth() Returns the month (0-11), UTC. 
getUTCSeconds() Returns the second (0-59), UTC. 
getYear() Returns the year calculated from the current year minus 1900. 
setDate(date ) Sets the day of the month. date , an integer from 1 to 31
setFullYear (year , month , date ) Sets the year, month, and date. year , a four-digit integer

month , an optional integer from 0 to 11

date , an optional integer from 1 to 31
setHours(hours , minutes , seconds , ms ) Sets the hour, minute, second, and millisecond. hours , an integer from 0 to 59

minutes , an optional integer from 0 to 59

seconds , an optional integer from 0 to 59

ms , an optional integer from 0 to 999
setMilliseconds(ms ) Sets the millisecond. ms , an integer from 0 to 999
setMinutes(minutes , seconds , ms ) Sets the minute, second, and millisecond. minutes , an integer from 0 to 59

seconds , an optional integer from 0 to 59

ms , an optional integer from 0 to 999
setMonth(month , date ) Sets the month and date. month , an integer from 0 to 11 date , an optional integer from 1 to 31
setSeconds(seconds , ms ) Sets the seconds and millisecond. seconds , an integer from 0 to 59 ms , an optional integer from 0 to 999
setTime(value ) Sets the number of milliseconds elapsed since midnight, January 1, 1970. value , an integer representing the elapsed time
setUTCDate(date ) Sets the day of the month, UTC. date , an integer from 1 to 31
setUTCFullYear (year , month , date ) Sets the year, month, and date, UTC. year , a four-digit integer

month , an optional integer from 0 to 11

date , an optional integer from 1 to 31
setUTCHours(hours , minutes , seconds , ms ) Sets the hour, minute, second, and millisecond, UTC. hours , an integer from 0 to 59

minutes , an optional integer from 0 to 59

seconds , an optional integer from 0 to 59

ms , an optional integer from 0 to 999
setUTCMilliseconds(ms ) Sets the millisecond, UTC. ms , an integer from 0 to 999
setUTCMinutes (minutes , seconds , ms ) Sets the minute, second, and millisecond, UTC. minutes , an integer from 0 to 59

seconds , an optional integer from 0 to 59

ms , an optional integer from 0 to 999
setUTCMonth (month , date ) Sets the month and date, UTC. month , an integer from 0 to 11 date , an optional integer from 1 to 31
setUTCSeconds (seconds , ms ) Sets the seconds and millisecond, UTC. seconds , an integer from 0 to 59 ms , an optional integer from 0 to 999
setYear (year , month , date ) Sets the four-digit year. year , a four-digit integer

month , an optional integer from 0 to 11

date , an optional integer from 1 to 31
toString() Returns a string of the values of a Date object. 



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint