Luxon provides DateTime, Duration, and Interval types for parsing, formatting, and arithmetic on dates and times in JavaScript.
Overview
Luxon is a library for working with dates and times in JavaScript. It centers on DateTime, Duration, and Interval types with an immutable, chainable API intended to stay unambiguous when composing operations.
Parsing and formatting support common and custom formats. Time zones and locales lean on the built-in Intl API rather than bundling separate locale or timezone data files. The API covers intervals between two instants, durations expressed as compound units, and math between values with explicit validity handling.
Internationalized string output uses Intl, and the library includes built-in timezone handling plus partial support for multiple calendar systems. Documentation covers formatting, parsing, zones, offsets, calendars, and migration notes for people moving from Moment.js.
Key features
- DateTime, Duration, and Interval types
- Immutable chainable API
- Intl-based time zones and locales
- Parsing and custom formatting
- Interval and duration math
- Built-in timezone handling
- Partial multi-calendar support
- Explicit validity on values
Use cases
- Formatting instants for display
- Timezone-aware scheduling logic
- Parsing user date input
- Replacing Moment.js in apps
- Duration and interval calculations