luxon
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
Luxon is a highly efficient JavaScript library for handling dates and times. It introduces various features such as DateTime, Duration, and Interval types, providing the ability to parse and format in common and custom formats. It's designed with an immutable, chainable, and unambiguous API with native time zone and international support.
Luxon is incredibly easy to use due to its chainable API. To utilize Luxon, you'll first need to install the package either via npm or Yarn. Once installed, you can import Luxon into your JavaScript file and start using its various features. Below is a simple usage example:
const { DateTime } = require('luxon');
let nowInNewYork = DateTime.now().setZone('America/New_York');
let oneWeekAgo = nowInNewYork.minus({ weeks: 1 });
let endOfDay = oneWeekAgo.endOf('day');
let ISOFormatTime = endOfDay.toISO();
console.log(ISOFormatTime);
This will retrieve the time for end of the day, one week ago, in New York, and convert it to an ISO string.
Luxon's extensive documentation can be found on its official website. You can access general documentation, API docs, quick tour, and many other helpful resources. Here are the links:
It's recommended to go through the documentation provided to understand Luxon's capabilities thoroughly and how to best utilize them for your JavaScript projects.