API Reference

Luxon

Modern JavaScript date and time library with full timezone, internationalization, and interval support.

Official Documentation ↗
CompatibilityThis documentation covers version v3.5. Check the official docs for the latest API surface.

Installation

npmnpm install luxon
pnpmpnpm add luxon
yarnyarn add luxon

Methods

Luxon is a library for working with dates and times in JavaScript. It offers a cleaner, more robust, and more powerful API than Moment.js, with full time zone and internationalization support built on the Intl API.

Key Features

  • Time zones: IANA zones via Intl, no data files needed
  • Duration & Interval: First-class types for spans of time
  • Immutable: All operations return new instances
  • Parsing & formatting: ISO 8601 and custom tokens
  • i18n: Locale-aware formatting using the Intl API

FAQ

Why use Luxon over Day.js or Moment?
Luxon has first-class time zone and IANAA support via the Intl API without extra data files, plus robust Duration and Interval types. It is larger than Day.js but more capable for global apps.
Does Luxon need a timezone data bundle?
No. Luxon uses the host Intl API for time zones and locales, so no extra tzdata bundle is required in modern environments. This keeps bundles small and data current with the runtime.
Is Luxon immutable?
Yes. All DateTime, Duration, and Interval methods return new instances. The original is never mutated, which prevents aliasing bugs and suits functional and React code.