Skip to content

Luxon

A JavaScript library for working with dates, times, and time zones.

Stars
16.5k
Forks
812
Licence
MIT
Language
JavaScript
Last update
3 months ago
Type
Library

What it is

Luxon is a JavaScript library for handling dates and times. It provides DateTime, Duration, and Interval types, and uses the browser or runtime's built-in Intl and time zone support rather than bundling its own locale or time zone data. Developers use it to parse, format, and do math on dates in a chainable, immutable way.

  • Get the current time in a named time zone such as America/New_York and shift it by weeks or days
  • Parse date strings in custom formats and output them as ISO 8601 text
  • Compute durations and intervals between two points in time
  • Format dates for different locales using built-in Intl support

Great for

  • JavaScript developers who need to work with dates and time zones in an app
  • Teams moving away from Moment.js, since the README has a guide for Moment users
  • Projects that want to avoid shipping large locale or time zone data files

Not ideal for

  • Non-developers, since it is a code library and needs to be called from a program
  • Projects that cannot rely on the platform's Intl and time zone support, since Luxon uses it rather than bundling its own data
  • Anyone who only needs a simple date display and not a library dependency
Step-by-step guide: how to use LuxonInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    Install from npm (package name from npm badge link)

    npm install luxon
  2. 2

    Run it

    • Install the package with npm install luxon
    • Import DateTime from luxon in your JavaScript file
    • Call DateTime.now() to get the current date and time
    • Chain methods such as setZone and minus to adjust the value, then call toISO() to output it
  3. 3

    Get the most out of it

    • Read the Quick tour and API docs on the project homepage for the full set of methods
    • Use the Moment users guide if migrating from Moment.js
    • Review the Intl-based formatting options for locale-specific output
    • Check the upgrade guide to Luxon 3.0 when moving between major versions

Downloads

Strengths

  • Immutable, chainable API that the README describes as unambiguous
  • Uses native time zone and Intl support, so no separate locale or time zone files are needed
  • MIT licensed with a large star count and documented API and upgrade guide

Trade-offs

  • Depends on the runtime's Intl and time zone support, so behavior can vary across environments (inferred from the feature description)
  • The README does not list a latest release, and the project mentions planning a major version 4.0, so check the current status before adopting
  • The README is brief; detailed usage is on the external documentation site

How it compares

ProjectStarsTypeLevelUpdatedBest for
luxon (this)16.5kLibrarybeginner3 months agoJavaScript developers who need to work with dates and time zones in an app
dayjs48.7kLibrarybeginner2 months agoJavaScript developers who used Moment.js and want a smaller library
flatpickr16.5kLibrarybeginner2.3 years agoWeb developers who need a date or time input in a JavaScript app
react-dates12.2kLibraryintermediate2.6 years agoReact developers who need a date or date-range picker in a web app

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.