JavaScript Date toLocaleTimeString() Method

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

What You’ll Learn

toLocaleTimeString() formats only the clock time of a Date for human readers using locale rules. Use it in chat timestamps, countdown labels, and schedules when the date is already shown elsewhere.

01

Syntax

locales, options

02

Time only

No date

03

timeStyle

Presets

04

hour12

AM/PM vs 24h

05

timeZone

IANA zones

06

Invalid

“Invalid Date”

Introduction

Apps often show the calendar date in one place and the clock time in another—a message list might read “Mar 15” with “2:30 PM” beside it. toLocaleTimeString() handles that second part with locale-aware formatting through the Intl engine.

For date and time together, use toLocaleString(). For date only, use toLocaleDateString(). For a quick fixed-pattern local time string, compare with toTimeString() (covered when you reach toString() family formatters).

Understanding the toLocaleTimeString() Method

Date.prototype.toLocaleTimeString([locales[, options]]) returns a localized string containing only the time portion of a Date instant:

  • Defaultdate.toLocaleTimeString() uses the runtime locale and a short time style.
  • Locales — BCP 47 tags like 'en-US' or 'en-GB'.
  • timeStyle — presets 'full', 'long', 'medium', 'short'.
  • Granular fieldshour, minute, second, plus hour12.
  • timeZone — display the instant as clock time in a specific IANA zone.
💡
Beginner Tip

toLocaleTimeString() never includes the calendar date. If your UI needs both, call toLocaleDateString() and toLocaleTimeString() separately—or use one toLocaleString() call.

📝 Syntax

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

Parameters

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

Return value

  • A localized time string (no date component).
  • "Invalid Date" if the Date is invalid.

⚡ Quick Reference

GoalCode
Default locale timedate.toLocaleTimeString()
US time with secondsdate.toLocaleTimeString('en-US')
Preset medium timedate.toLocaleTimeString('en-US', { timeStyle: 'medium' })
24-hour clockdate.toLocaleTimeString('en-GB', { hour12: false })
Time in Londondate.toLocaleTimeString('en-GB', { timeZone: 'Europe/London' })
Full date + timedate.toLocaleString()

📋 toLocaleTimeString() vs Similar Methods

Choose the formatter that matches how much of the instant you need to display.

toLocaleTimeString()
locale time

Clock only

toLocaleString()
date + time

Full label

toLocaleDateString()
date only

Calendar part

toISOString()
UTC ISO

APIs / storage

Examples Gallery

Open DevTools Console (F12) or use Try-it links. Fixed UTC instants keep output predictable across examples.

📚 Getting Started

Format a fixed local time with the runtime default locale.

Example 1 — Default toLocaleTimeString()

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

JavaScript
const date = new Date(2026, 2, 15, 14, 30, 45);
const timeLabel = date.toLocaleTimeString();

console.log(timeLabel); // e.g. "2:30:45 PM" in en-US
Try It Yourself

How It Works

With no arguments, the engine applies a short time style for the default locale. Only the clock portion appears—no month or year.

📈 Practical Patterns

Locales, presets, clock format, and time zones.

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

One UTC instant, two regional clock presentations.

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

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

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

How It Works

Fixing timeZone: 'UTC' isolates locale differences. US English defaults to 12-hour AM/PM; German defaults to 24-hour time.

Example 3 — timeStyle Presets

Compact chat timestamps vs detailed event clocks.

JavaScript
const alarm = new Date(Date.UTC(2026, 2, 15, 7, 5, 30));

console.log(alarm.toLocaleTimeString('en-US', {
  timeStyle: 'short',
  timeZone: 'UTC'
}));
// "7:05 AM"

console.log(alarm.toLocaleTimeString('en-US', {
  timeStyle: 'medium',
  timeZone: 'UTC'
}));
// "7:05:30 AM"
Try It Yourself

How It Works

timeStyle: 'short' omits seconds for compact UI. 'medium' includes seconds when the locale supports it.

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

Override locale defaults when your design requires a specific clock style.

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

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

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

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

How It Works

When specifying individual time fields, set hour12 explicitly so UI behavior stays consistent across locales.

Example 5 — Show Clock Time in Europe/London

Remote teams see office hours in the target zone.

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

const utcTime = now.toLocaleTimeString('en-GB', {
  timeZone: 'UTC',
  hour12: false
});

const londonTime = now.toLocaleTimeString('en-GB', {
  timeZone: 'Europe/London',
  hour12: false
});

console.log('UTC:', utcTime);       // "15:00:00"
console.log('London:', londonTime); // "16:00:00" (BST in June)
Try It Yourself

How It Works

The stored instant is unchanged—only the displayed clock shifts with the zone. Store ISO; format with timeZone when rendering.

🚀 Common Use Cases

  • Chat timestamps — compact timeStyle: 'short' beside each message.
  • Office hours — show support desk times in the user’s timeZone.
  • Media players — current playback position as locale time labels.
  • Calendar grids — time column when the date header is separate.
  • Countdown follow-ups — “Reminder at 3:00 PM” in the visitor’s locale.
  • Flight dashboards — departure clock in origin airport zone.

🧠 How toLocaleTimeString() 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 hour, minute, and second fields.

TZ
3

Intl formatting

Options or timeStyle map to Intl time parts only.

Intl
4

Return string

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

📝 Notes

  • Time only—no calendar date in the output.
  • 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 toLocaleTimeString() at display time.
  • Invalid dates return "Invalid Date".
  • Avoid mixing timeStyle with conflicting granular field options in one call.

Browser & Runtime Support

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

Baseline · Intl

Date.prototype.toLocaleTimeString()

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.toLocaleTimeString() Excellent

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

Conclusion

toLocaleTimeString() is the right tool when users need readable clock labels without repeating the calendar date. Combine locales, timeStyle, hour12, and timeZone to match regional expectations.

Next, learn toString() for the default string representation of a Date, or review toLocaleString() for combined date-and-time labels.

💡 Best Practices

✅ Do

  • Use timeStyle: 'short' for compact message timestamps
  • Set timeZone when showing remote office hours
  • Pass explicit locales when your app supports language switching
  • Set hour12 when your UI requires a fixed clock style
  • Pair with toLocaleDateString() when date and time sit in separate columns

❌ Don’t

  • Expect calendar date text from toLocaleTimeString()
  • Parse locale time strings back to Date objects with regex
  • Store locale-formatted time strings as your source of truth
  • Mix timeStyle with conflicting field options in one call
  • Use locale time strings in API payloads instead of ISO

Key Takeaways

Knowledge Unlocked

Five things to remember about Date.toLocaleTimeString()

Your foundation for locale-aware clock labels in JavaScript.

5
Core concepts
🕓 02

Time only

No date.

Scope
📋 03

timeStyle

short/medium.

Presets
🕐 04

hour12

AM/PM vs 24h.

Clock
🌐 05

timeZone

IANA names.

Regions

❓ Frequently Asked Questions

A string with only the time portion of the Date formatted for a locale — for example, "2:30:00 PM" in en-US or "14:30:00" in de-DE. The calendar date is not included.
toLocaleTimeString() formats clock time only. toLocaleString() includes both date and time. Pair toLocaleDateString() + toLocaleTimeString() when you want separate UI columns.
Pass hour12: false in the options object, or use a locale that defaults to 24-hour time such as de-DE with timeStyle presets.
Yes. Set timeZone in options — for example, { timeZone: 'Europe/London' } — to display the instant as it appears in that zone.
Common options include timeStyle ('full', 'long', 'medium', 'short'), hour, minute, second, hour12, and timeZone. Do not mix timeStyle with conflicting granular fields in one call.
It returns the string "Invalid Date". Validate with Number.isNaN(date.getTime()) before formatting in UI code.
Did you know?

toLocaleString() is implemented as date plus time formatting—internally similar to calling locale date and time formatters together. When you only need one half, dedicated methods avoid redundant text.

Continue to toString()

Learn the default string representation JavaScript uses when a Date is coerced to text.

toString() 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