JavaScript Date Methods

  • Date Get Methods
Method         Description
getDate()           Get the day as a number (1-31)
getDay()                 Get the weekday as a number (0-6)
getFullYear()         Get the four digit year (yyyy)
getHours()          Get the hour (0-23)
getMilliseconds() Get the milliseconds (0-999)
getMinutes()         Get the minutes (0-59)
getMonth()         Get the month (0-11)
getSeconds()         Get the seconds (0-59)
getTime()                 Get the time (milliseconds since January 1, 1970)

Note : In JavaScript, the first day of the week (0) means "Sunday", even if some countries in the world consider the first day of the week to be "Monday". 

Date Set Methods

Method Description
setDate()         Set the day as a number (1-31)
setFullYear() Set the year (optionally month and day)
setHours()         Set the hour (0-23)
setMilliseconds()   Set the milliseconds (0-999)
setMinutes() Set the minutes (0-59)
setMonth()         Set the month (0-11)
setSeconds() Set the seconds (0-59)
setTime()         Set the time (milliseconds since January 1, 1970)

Comments

Popular posts from this blog

Bootstrap Breakpoints