Date.toString

toString – Converts a Date object to a string.

Description

Date.toString()

Since toString sometimes is used to implement other return values, it is recomended to use the toLocaleString method instead.

Return values

string primitive.

Examples

Example #1 – toString example
var date = new Date(); console.log(date.toString()); // Returns a string representation of the given date and time.

See also

External references