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>
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 Minified

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.