JavaScript Tutorial

Javascript Date Formats

This date object can be used to get a year, month and day. We can display a timer on the webpage with the help of a JavaScript date object.

The formats of JavaScript's date are defined as follows:

ISO Date

This date format is the international standard for the times and dates, and the syntax (YYYY-MM-DD) of this standard is the preferred date format in JavaScript.

Input:-

Output:-

Short Date

This method use "MM/DD/YYYY"  format to write short dates.

Input:-

Output:-

Long Date

This method use "MMM DD YYYY" format to write Long dates. The month and date can be written in any order, and it is allowed to write a month in abbreviated (Aug) form or in full (August).

Input:-

Output:-

 

Go back to Previous Course