There are generally 4 types of JavaScript date input formats:

Type Example
ISO Date “2015-03-25” (The International Standard)
Short Date “03/25/2015”
Long Date “Mar 25 2015” or “25 Mar 2015”
Full Date “Wednesday March 25 2015”

The ISO format follows a strict standard in JavaScript. The other formats are not so well defined and might be browser specific.

In some browsers, months or days with no leading zeroes may produce an error:

var d = new Date("2015-3-25");

The behavior of “YYYY/MM/DD” or “DD-MM-YYYY” is undefined. Some browsers will try to guess the format. Some will return NaN.

var d = new Date("2015/03/25");
var d = new Date("25-03-2015");

Independent of input format, JavaScript will (by default) output dates in full text string format:

Wed Mar 25 2015 09:00:00 GMT+0900 (KST)

Yonggoo Noh

I am interested in Computer science and Mathematics.