JavaScript toLocaleString() Method
Clash Royale CLAN TAG#URR8PPP
<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]-->
JavaScript toLocaleString() Method
❮ JavaScript Date Object
Example
Convert a Date object to a string, using locale conventions:
var d = new Date();
var n = d.toLocaleString();
<!--
The result of n will be:
var d = new Date();
document.write(d.toLocaleString());
-->Try it Yourself »
Definition and Usage
The toLocaleString() method converts a Date object to a string, using locale settings.
Browser Support
Method | |||||
---|---|---|---|---|---|
toLocaleString() | Yes | Yes | Yes | Yes | Yes |
Syntax
Date.toLocaleString()
Technical Details
Return Value: | A String, representing the date and time as a string |
---|---|
JavaScript Version: | ECMAScript 1 |
❮ JavaScript Date Object