JavaScript toString() method

The JavaScript date toString() method is used to get the date in the form of a string.

Syntax:

dateObj.toString();

Return:
String representation of the date portion of a Date object.

Example:

<!DOCTYPE html>
<html>
<body>
<script>
var bday=new Date("November 16, 1994 21:10:10");
document.writeln(bday.toString());
</script>
</body>
</html>