- Home
- /
- Tutorials
- /
- JavaScript Tutorial
- /
- JavaScript Date Formatting
JavaScript Dates
JavaScript Date Formatting
toLocaleDateStringformats a date the way a reader in a given place expects.
Never build a date string by joining the parts yourself.
The rules differ by country and the built-in formatters know them.
Example
Example
javascript
const date = new Date(Date.UTC(2026, 0, 15));
console.log(date.toLocaleDateString("en-GB", { timeZone: "UTC" }));