Where can I find documentation on formatting a date in JavaScript?


The Date object is a datatype built into the JavaScript language. Date objects are created with the new Date( ) as shown below −

new Date( )
new Date(milliseconds)
new Date(datestring)
new Date(year,month,date[,hour,minute,second,millisecond ])

The following method is used to Manipulate Dates in JavaScript −

Sr.No
Method & Description
1Date()
Returns today's date and time
2getDate()
Returns the day of the month for the specified date according to local time.
3getDay()
Returns the day of the week for the specified date according to local time.
4getFullYear()
Returns the year of the specified date according to local time.
5getHours()
Returns the hour in the specified date according to local time.
6getMilliseconds()
Returns the milliseconds in the specified date according to local time.
7getMinutes()
Returns the minutes in the specified date according to local time.

For complete documentation and examples, refer to the following resource.

Updated on: 23-Jun-2020

37 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements