Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

toString Method (Date)

Returns a string representation of a date. The format of the string depends on the locale. For U.S. English (en-us), it is as follows:

day of the week month day hour: minute:second time zone year


Required. The date to represent as a string.

Returns the string representation of the date.

The following example illustrates the use of the toString method with a date.

var myDate = new Date();
myDate.setFullYear(2100, 5, 5);
var dateString = myDate.toString();

// Output: <date>

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported Store apps (Windows 8 and Windows Phone 8.1). See Version Information.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.