Returns a string with a locale-sensitive representation of the date.
Syntax
date.toLocaleDateString(locale, options?)Example
Enter values below to update the example in real time.
const→new→console→toLocaleDateString→const date = new Date(2024, 5, 15);
console.log(date.toLocaleDateString("ko-KR"));
// "2024. 6. 15."
console.log(date.toLocaleDateString("en-US"));
// "6/15/2024"