Javascript Reference - JavaScript Date toString() Method








The toString() method returns the date and time with time-zone information.

Browser Support

toString() Yes Yes Yes Yes Yes

Syntax

dateObject.toString();

Parameters

None;

Return Value

A string representing the date and time as a string.





Example


var aDate = new Date(Date.UTC(2000, 0)); 
console.log(aDate);
console.log(aDate.toString())

The code above generates the following result.