explaingit

moment/luxon

Analysis updated 2026-06-24

16,396JavaScriptAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

Luxon is a JavaScript library for dates, times, time zones, and durations. Modern successor to Moment.js with immutable types.

Mindmap

mindmap
  root((luxon))
    Inputs
      ISO strings
      Native Date objects
      Custom format strings
    Outputs
      DateTime objects
      Duration objects
      Interval objects
      Formatted strings
    Use Cases
      Parse and format dates
      Time zone math
      Date arithmetic
      Display durations
    Tech Stack
      JavaScript
      Node.js
      Intl API
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Format and parse dates across time zones in a Node or browser app

USE CASE 2

Calculate durations and intervals between two events

USE CASE 3

Replace Moment.js in an existing codebase with an immutable API

What is it built with?

JavaScriptNode.jsIntl API

How does it compare?

moment/luxondiygod/dplayerbrix/crypto-js
Stars16,39616,39016,389
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Older Node versions without full Intl support need a polyfill for non-English locales.

Use freely for any purpose including commercial, as long as you keep the copyright notice.

In plain English

Luxon is a JavaScript library for working with dates, times, time zones, and durations. It is maintained under the Moment.js organization and is considered a modern successor to Moment.js, addressing several design issues from that older library. The README's opening code example shows the chainable API: you can take the current date and time, shift it to a specific time zone, subtract a week, move to the end of that day, and format the result as an ISO string, all in a single readable chain of method calls. Luxon's key features are its three main types, DateTime (a specific point in time), Duration (an amount of time like "3 hours and 20 minutes"), and Interval (a span of time between two DateTimes), and the fact that these are immutable objects, meaning operations return new objects rather than modifying the original. This prevents a common class of bugs where multiple parts of your code accidentally share and change the same date object. Time zone support is built in using the browser's or Node's native Internationalization (Intl) API, so there are no extra locale or time zone data files to bundle. It also handles parsing and formatting for standard and custom date formats. You would use Luxon when your JavaScript or Node.js application needs to do anything involving dates and times beyond simple comparisons, calculating durations, displaying times in different time zones, parsing dates from strings, or doing date arithmetic. It is MIT-licensed and installed via npm.

Copy-paste prompts

Prompt 1
Show me how to install Luxon and convert a UTC timestamp to America/New_York for display
Prompt 2
Write a Luxon function that returns the number of business days between two ISO date strings
Prompt 3
Convert this Moment.js code to Luxon and explain the immutability differences
Prompt 4
Build a Luxon helper that formats a Duration as 2h 15m for a stopwatch UI

Frequently asked questions

What is luxon?

Luxon is a JavaScript library for dates, times, time zones, and durations. Modern successor to Moment.js with immutable types.

What language is luxon written in?

Mainly JavaScript. The stack also includes JavaScript, Node.js, Intl API.

What license does luxon use?

Use freely for any purpose including commercial, as long as you keep the copyright notice.

How hard is luxon to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is luxon for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub moment on gitmyhub

Verify against the repo before relying on details.