JavaScript Date toLocaleDateString() Method

Definition and Usage

toLocaleDateString() The method uses regional conventions (locale conventions) to convert the date (not the time) of the Date object to a readable string.

Example

Use regional conventions to return the Date object as a string:

var d = new Date();
var n = d.toLocaleDateString();

Try It Yourself

Syntax

Date.toLocaleDateString()

Technical Details

Return Value: A string representing a date in string format.
JavaScript Version: ECMAScript 1

Browser Support

Method Chrome IE Firefox Safari Opera
toLocaleDateString() Support Support Support Support Support

Related Pages

Tutorial:JavaScript Date

Tutorial:JavaScript Date Format

Tutorial:JavaScript String