English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
toString()The method returns a string representing the specified date object.
When the Date is represented as a string, JavaScript automatically callstoString()Method.
date.toString()
var d = new Date(); document.getElementById('result').innerHTML = d.toString();Test and see‹/›
All browsers fully support the toString() method:
Method | |||||
toString() | Yes | Yes | Yes | Yes | Yes |
Return value: | String representation of a date |
---|---|
JavaScript Version: | ECMAScript 1 |