English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

JavaScript Date toString() Method

 JavaScript Date Object

toString()The method returns a string representing the specified date object.

When the Date is represented as a string, JavaScript automatically callstoString()Method.

Syntax:

date.toString()
var d = new Date();
document.getElementById('result').innerHTML = d.toString();
Test and see‹/›

Browser Compatibility

All browsers fully support the toString() method:

Method
toString()YesYesYesYesYes

Technical Details

Return value:String representation of a date
JavaScript Version:ECMAScript 1

 JavaScript Date Object