Get started with luxon CDN
Stable version
Copied!
How to start using luxon CDN
// Import Luxon library
const luxon = typeof window !== 'undefined' ? window.luxon : require('luxon');
// Create a DateTime object from a string
const now = luxon.DateTime.fromISO('2023-03-15T14:30:00.000Z');
// Add some time to the DateTime object
const future = now.plus({ minutes: 30 });
// Get the ISO string representation of the new DateTime object
const futureISODateTime = future.toISO();
// Log the result
console.log(futureISODateTime); // Output: "2023-03-15T15:00:00.000Z"
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!