Easy Tutorial
❮ Event Oncontextmenu Met Text Focus ❯

JavaScript toLocaleDateString() Method

JavaScript Date Object

Example

Convert the date portion of a Date object into a string based on local time:

n Output result:


Definition and Usage

The toLocaleDateString() method converts the date portion of a Date object into a string, based on local time, and returns the result.


Browser Support

All major browsers support the toLocaleDateString() method.


Syntax

Return Value

Type Description
String A string representation of the date portion of the date Object, expressed in the local time zone and formatted according to local conventions.

Technical Details

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


JavaScript Date Object

❮ Event Oncontextmenu Met Text Focus ❯