Fork me on GitHub

Luxon

A powerful, modern, and friendly wrapper for Javascript dates and times.

                
DateTime.local().setZone('America/New_York').minus({ weeks: 1 }).endOf('day').toISO();
                
            

Features

Documentation

Download

Browser global Debug Minified

Exports a global variable called "luxon". Use it like this

<script src="luxon.js"></script>
<script>luxon.DateTime.local();</script>

See the install instructions for details on older browsers, including IE 11.

Demo
Node
npm install luxon

Luxon as a Node.js module

var { DateTime } = require('luxon');
DateTime.local();
AMD Debug Minified

Luxon as an AMD module. Use with Require.js, System.js, and so on.

requirejs(['luxon'], function(luxon) {
luxon.DateTime.local();
});
Demo
ES6 Debug

Luxon as an ES6 module.

import { DateTime } from 'luxon';
DateTime.local();

More details are available in the install guide.

Contribute

Luxon is distributed under the MIT license. The code is available on GitHub. Patches welcome.