
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 |
---|---|
1 |
Date() Returns today's date and time |
2 |
getDate() Returns the day of the month for the specified date according to local time. |
3 |
getDay() Returns the day of the week for the specified date according to local time. |
4 |
getFullYear() Returns the year of the specified date according to local time. |
5 |
getHours() Returns the hour in the specified date according to local time. |
6 |
getMilliseconds() Returns the milliseconds in the specified date according to local time. |
7 |
getMinutes() Returns the minutes in the specified date according to local time. |
For complete documentation and examples, refer to the following resource.
Advertisements