Easy Tutorial
❮ Jsref Parse Met Canvas Arc ❯

JavaScript toLocaleString() Method

JavaScript Date Object

Example

Convert a Date object to a string based on local time:

n Output result:


Definition and Usage

The toLocaleString() method converts a Date object to a string, formatted according to local time, and returns the result.


Browser Support

All major browsers support the toLocaleString() method.


Syntax

Return Value

Type Description
String The date and time output as a string.

Technical Details

| JavaScript Version: | 1.0 | | --- | --- |


JavaScript Date Object

❮ Jsref Parse Met Canvas Arc ❯