Export (0) Print
Expand All
Expand Minimize

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

V0040:

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, and IE11 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:

       DDDbMMMbddbhh:mm:ssbzzzzzzbyyyyy

  5. Return Result(4).

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

Variable

Description

DDD

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

b

A single space character.

MMM

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

dd

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

hh

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

:

The colon character.

mm

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

ss

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.

yyyyy

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.

UTC

The literal characters UTC.

Show:
© 2014 Microsoft