2.1.18 [ECMA-262/5] Section, Date.prototype.toString ()


The specification states:

 This function returns a String value. The contents of the String are implementation-dependent, but are intended to represent the Date in the current time zone in a convenient, human-readable form.

IE9 Mode, IE10 Mode, IE11 Mode, and EdgeHTML Mode (All Versions)

The returned String value of the Date.prototype.toString method is determined from the following steps:

  1. Let tv be the time value.

  2. If tv is NaN, return the string "NaN".

  3. Let t be LocalTime(tv).

  4. Using t, create a string value that has the following format, according to the items that are defined in the following table:


  5. Return Result(4).

The following table defines the variables in the string value that is referenced in the preceding steps.




The day of the week abbreviation from the following set: Sun Mon Tue Wed Thu Fri Sat.


A single space character.


The month name abbreviation from the following set: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec.


The day of the month as a one-decimal or two-decimal number, from 1 to 31.


The number of complete hours since midnight as a two-decimal number.


The colon character.


The number of complete minutes since the start of the hour, as a two-decimal number.


The number of complete seconds since the start of the minute, as a two-decimal number.

zzz or zzzzzzzz

If the local time offset from UTC is an integral number of hours between -8 and -5 inclusive, this item is the standard abbreviation for the corresponding North American time zone. This time zone is one of the following set: EST EDT CST CDT MST MDT PST PDT. Otherwise, this item is the characters UTC followed by a plus sign (+) or minus sign () character that corresponds to the sign of the local offset from UTC followed by the two-decimal hours part of the UTC offset and the two-decimal minutes part of the UTC offset.


If YearFromTime(t) is greater than 0, this item is three or more digits from the value of YearFromTime(t). Otherwise, this item is the one or more numbers that correspond to the number that is 1-YearFromTime(t) followed by a single space character and then followed by B.C.


The comma character.


The literal characters UTC.