JavaScript Date toLocaleString() Method

Beginner
⏱️ 9 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Date + time locale

What You’ll Learn

toLocaleString() formats both the date and time of a Date for human readers using locale rules. Pass a language tag and options for presets, 12/24-hour clocks, and IANA time zones—ideal for activity feeds, order history, and multilingual apps.

01

Syntax

locales, options

02

Date + time

Full label

03

Styles

date/timeStyle

04

hour12

AM/PM vs 24h

05

timeZone

IANA zones

06

Invalid

“Invalid Date”

Introduction

When users see “last updated” timestamps or meeting times, they expect familiar date-and-time text—not raw ISO strings. toLocaleString() uses the Intl engine to produce readable labels that respect language and regional conventions.

For date-only labels, use toLocaleDateString(). For storage and APIs, keep using toISOString() or toJSON(), then format with toLocaleString() at display time.

Understanding the toLocaleString() Method

Date.prototype.toLocaleString([locales[, options]]) returns a localized string containing both calendar date and clock time:

  • Defaultdate.toLocaleString() uses the runtime locale and short date/time styles.
  • Locales — BCP 47 tags like 'en-US' or 'de-DE', or an array of fallbacks.
  • PresetsdateStyle and timeStyle ('full', 'long', 'medium', 'short').
  • Granular fieldsweekday, month, day, hour, minute, second, plus hour12.
  • timeZone — format the instant as it appears in a specific IANA zone.
💡
Beginner Tip

toLocaleString() is the date+time counterpart to toLocaleDateString(). If you only need the clock portion, use toLocaleTimeString() instead.

📝 Syntax

JavaScript
dateObj.toLocaleString([locales[, options]])

Parameters

  • locales (optional) — string or array of BCP 47 locale tags.
  • options (optional) — Intl date/time fields, dateStyle/timeStyle, or timeZone.

Return value

  • A localized date-and-time string.
  • "Invalid Date" if the Date is invalid.

⚡ Quick Reference

GoalCode
Default locale datetimedate.toLocaleString()
German datetimedate.toLocaleString('de-DE')
Preset full date + short timedate.toLocaleString('en-US', { dateStyle: 'full', timeStyle: 'short' })
24-hour clockdate.toLocaleString('en-GB', { hour12: false })
Datetime in a zonedate.toLocaleString('en-US', { timeZone: 'UTC' })
API storage formatdate.toISOString()

📋 toLocaleString() vs Similar Methods

Pick the formatter that matches how much of the instant you need to show.

toLocaleString()
date + time

Full UI label

toLocaleDateString()
date only

Calendar part

toLocaleTimeString()
time only

Clock part

toISOString()
UTC ISO

APIs / storage

Examples Gallery

Open DevTools Console (F12) or use Try-it links. Examples use fixed instants so you can compare output reliably.

📚 Getting Started

Format a fixed instant with the runtime default locale.

Example 1 — Default toLocaleString()

March 15, 2026 at 14:30 local time with your browser’s default rules.

JavaScript
const date = new Date(2026, 2, 15, 14, 30, 0);
const label = date.toLocaleString();

console.log(label); // e.g. "3/15/2026, 2:30:00 PM" in en-US
Try It Yourself

How It Works

With no arguments, the engine applies short date and time styles for the default locale. Output varies by locale and time zone.

📈 Practical Patterns

Locales, preset styles, clock format, and time zones.

Example 2 — Same Instant in en-US and de-DE

One UTC instant, two regional presentations.

JavaScript
const instant = new Date(Date.UTC(2026, 2, 15, 14, 30, 0));

console.log(instant.toLocaleString('en-US', { timeZone: 'UTC' }));
// "3/15/2026, 2:30:00 PM"

console.log(instant.toLocaleString('de-DE', { timeZone: 'UTC' }));
// "15.3.2026, 14:30:00"
Try It Yourself

How It Works

Fixing timeZone: 'UTC' keeps both lines comparable. German locale uses 24-hour time by default; US locale uses 12-hour with AM/PM.

Example 3 — dateStyle and timeStyle Presets

Readable event headers without listing every field manually.

JavaScript
const meeting = new Date(Date.UTC(2026, 5, 20, 15, 0, 0));

const label = meeting.toLocaleString('en-US', {
  dateStyle: 'full',
  timeStyle: 'short',
  timeZone: 'UTC'
});

console.log(label);
// "Saturday, June 20, 2026 at 3:00 PM"
Try It Yourself

How It Works

dateStyle and timeStyle combine date and clock parts in one call. Do not mix them with conflicting individual field options in the same object.

Example 4 — Control 12-Hour vs 24-Hour with hour12

Force AM/PM or 24-hour display regardless of locale defaults.

JavaScript
const date = new Date(Date.UTC(2026, 2, 15, 14, 30, 0));

const twelve = date.toLocaleString('en-US', {
  timeZone: 'UTC',
  hour: 'numeric',
  minute: 'numeric',
  hour12: true
});

const twentyFour = date.toLocaleString('en-US', {
  timeZone: 'UTC',
  hour: 'numeric',
  minute: 'numeric',
  hour12: false
});

console.log(twelve);      // "2:30 PM"
console.log(twentyFour);  // "14:30"
Try It Yourself

How It Works

When you specify individual time fields, include hour12 explicitly if your UI must always use one clock style.

Example 5 — Show the Same Instant in Different timeZone Values

Global teams see meeting times in their own zone.

JavaScript
const webinar = new Date(Date.UTC(2026, 2, 15, 18, 0, 0));

const zones = ['UTC', 'America/New_York', 'Asia/Tokyo'];

for (const zone of zones) {
  console.log(
    zone + ':',
    webinar.toLocaleString('en-US', {
      dateStyle: 'medium',
      timeStyle: 'short',
      timeZone: zone
    })
  );
}
Try It Yourself

How It Works

The stored instant never changes—only the displayed local date and time shift with the zone. Store ISO; format with timeZone at render time.

🚀 Common Use Cases

  • Activity feeds — “Posted Mar 15, 2026, 2:30 PM” in the user’s locale.
  • Order history — purchase timestamps with dateStyle: 'medium'.
  • Meeting invites — show start time in each attendee’s timeZone.
  • Admin dashboards — switch locale when staff change language preference.
  • Chat messages — compact timeStyle: 'short' beside full date on hover.
  • Audit logs (UI) — human-readable view while JSON logs keep ISO underneath.

🧠 How toLocaleString() Builds the Label

1

Resolve locale

Engine picks the BCP 47 tag from the argument or runtime default.

locale
2

Apply time zone

Local zone or timeZone option sets calendar and clock fields.

TZ
3

Intl formatting

Options or style presets map to Intl date and time parts.

Intl
4

Return string

A localized date+time label is returned; the Date object is unchanged.

📝 Notes

  • Includes both date and time—unlike toLocaleDateString().
  • Read-only: does not mutate the Date.
  • Output varies by locale, options, and time zone—do not parse it back to dates in production.
  • Store ISO or epoch; format with toLocaleString() at display time.
  • Invalid dates return "Invalid Date".
  • Avoid mixing dateStyle/timeStyle with conflicting granular field options in one call.

Browser & Runtime Support

Date.prototype.toLocaleString() with locales and options is widely supported via Intl in modern environments.

Baseline · Intl

Date.prototype.toLocaleString()

Supported in Chrome, Firefox, Safari, Edge, and Node.js. Very old browsers had limited locale support; target modern baselines for rich options.

98% Universal API
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
Date.toLocaleString() Excellent

Bottom line: Safe for modern apps. Remember date+time scope, locale variance, and ISO for storage.

Conclusion

toLocaleString() is the go-to formatter when users need to see both calendar date and clock time in a familiar regional style. Combine locales, style presets, and timeZone to build inclusive, readable UIs.

Next, learn toLocaleTimeString() when you only need the time portion, or review toLocaleDateString() for date-only labels.

💡 Best Practices

✅ Do

  • Format at display time from stored ISO or epoch values
  • Use dateStyle + timeStyle for consistent presets
  • Set timeZone for remote teams and scheduled events
  • Pass explicit locales when your app supports language switching
  • Set hour12 when your UI requires a fixed clock style

❌ Don’t

  • Store locale-formatted strings as your source of truth
  • Parse toLocaleString() output with regex
  • Use it for API payloads instead of toISOString()
  • Assume all locales use 12-hour time without checking hour12
  • Mix style presets with conflicting field options in one call

Key Takeaways

Knowledge Unlocked

Five things to remember about Date.toLocaleString()

Your foundation for locale-aware date-and-time labels.

5
Core concepts
🕐 02

Date + time

Full label.

Scope
📋 03

Styles

date/timeStyle.

Presets
🕓 04

hour12

AM/PM vs 24h.

Clock
🌐 05

timeZone

IANA names.

Regions

❓ Frequently Asked Questions

A string with both the date and time portions of the Date formatted for a locale — for example, "3/15/2026, 2:30:00 PM" in en-US. It is meant for human-readable display, not API storage.
toLocaleString() includes date and time. toLocaleDateString() includes only the calendar date. Use toLocaleTimeString() when you need time alone.
Pass hour12: true or hour12: false in the options object, or use timeStyle presets that follow locale defaults.
Yes. Options like { dateStyle: 'full', timeStyle: 'short' } are a convenient way to format both parts without listing every field.
By default it uses the runtime local time zone. Set the timeZone option (for example, 'UTC' or 'Europe/Berlin') to format the instant as it appears in another zone.
It returns the string "Invalid Date". Validate with Number.isNaN(date.getTime()) before formatting in UI code.
Did you know?

Number.prototype.toLocaleString() is a different method—it formats numbers with locale grouping separators. On Date objects, toLocaleString() always refers to date-and-time formatting via Intl.

Continue to toLocaleTimeString()

Format only the clock portion when the calendar date is shown elsewhere.

toLocaleTimeString() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful