@types/luxon

  • Version 3.4.2
  • Published
  • 120 kB
  • No dependencies
  • MIT license

Install

npm i @types/luxon
yarn add @types/luxon
pnpm add @types/luxon

Overview

TypeScript definitions for luxon

Index

Variables

Classes

Interfaces

Type Aliases

Namespaces

Variables

variable VERSION

const VERSION: string;

    Classes

    class DateTime

    class DateTime<IsValid extends boolean = DefaultValidity> {}

    property DATE_FULL

    static readonly DATE_FULL: Intl.DateTimeFormatOptions;

    property DATE_HUGE

    static readonly DATE_HUGE: Intl.DateTimeFormatOptions;

    property DATE_MED

    static readonly DATE_MED: Intl.DateTimeFormatOptions;

    property DATE_MED_WITH_WEEKDAY

    static readonly DATE_MED_WITH_WEEKDAY: Intl.DateTimeFormatOptions;

    property DATE_SHORT

    static readonly DATE_SHORT: Intl.DateTimeFormatOptions;

    property DATETIME_FULL

    static readonly DATETIME_FULL: Intl.DateTimeFormatOptions;

    property DATETIME_FULL_WITH_SECONDS

    static readonly DATETIME_FULL_WITH_SECONDS: Intl.DateTimeFormatOptions;

    property DATETIME_HUGE

    static readonly DATETIME_HUGE: Intl.DateTimeFormatOptions;
    • DateTime.toLocaleString format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.

    property DATETIME_HUGE_WITH_SECONDS

    static readonly DATETIME_HUGE_WITH_SECONDS: Intl.DateTimeFormatOptions;
    • DateTime.toLocaleString format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.

    property DATETIME_MED

    static readonly DATETIME_MED: Intl.DateTimeFormatOptions;

    property DATETIME_MED_WITH_SECONDS

    static readonly DATETIME_MED_WITH_SECONDS: Intl.DateTimeFormatOptions;

    property DATETIME_MED_WITH_WEEKDAY

    static readonly DATETIME_MED_WITH_WEEKDAY: Intl.DateTimeFormatOptions;

    property DATETIME_SHORT

    static readonly DATETIME_SHORT: Intl.DateTimeFormatOptions;

    property DATETIME_SHORT_WITH_SECONDS

    static readonly DATETIME_SHORT_WITH_SECONDS: Intl.DateTimeFormatOptions;

    property day

    readonly day: number;
    • Get the day of the month (1-30ish).

      Example 1

      DateTime.local(2017, 5, 25).day //=> 25

    property daysInMonth

    readonly daysInMonth: PossibleDaysInMonth;
    • Returns the number of days in this DateTime's month

      Example 1

      DateTime.local(2016, 2).daysInMonth //=> 29

      Example 2

      DateTime.local(2016, 3).daysInMonth //=> 31

    property daysInYear

    readonly daysInYear: number;
    • Returns the number of days in this DateTime's year

      Example 1

      DateTime.local(2016).daysInYear //=> 366

      Example 2

      DateTime.local(2013).daysInYear //=> 365

    property hour

    readonly hour: number;
    • Get the hour of the day (0-23).

      Example 1

      DateTime.local(2017, 5, 25, 9).hour //=> 9

    property invalidExplanation

    readonly invalidExplanation: string;
    • Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid

    property invalidReason

    readonly invalidReason: string;
    • Returns an error code if this DateTime is invalid, or null if the DateTime is valid

    property isInDST

    readonly isInDST: boolean;
    • Get whether the DateTime is in a DST.

    property isInLeapYear

    readonly isInLeapYear: boolean;
    • Returns true if this DateTime is in a leap year, false otherwise

      Example 1

      DateTime.local(2016).isInLeapYear //=> true

      Example 2

      DateTime.local(2013).isInLeapYear //=> false

    property isOffsetFixed

    readonly isOffsetFixed: boolean;
    • Get whether this zone's offset ever changes, as in a DST.

    property isValid

    readonly isValid: boolean;
    • Returns whether the DateTime is valid. Invalid DateTimes occur when: * The DateTime was created from invalid calendar information, such as the 13th month or February 30 * The DateTime was created by an operation on another invalid date

    property isWeekend

    readonly isWeekend: boolean;
    • Returns true if this date is on a weekend, according to the locale, false otherwise

    property locale

    readonly locale: string;
    • Get the locale of a DateTime, such as 'en-GB'. The locale is used when formatting the DateTime

    property localWeekday

    readonly localWeekday: number;
    • Get the day of the week, according to the locale. 1 is the first day of the week, and 7 is the last day of the week. If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1.

    property localWeekNumber

    readonly localWeekNumber: number;
    • Get the week number of the week year, according to the locale. Different locales assign week numbers differently. The week can start on different days of the week (see localWeekday), and because a different number of days is required for a week to count as the first week of a year.

    property localWeekYear

    readonly localWeekYear: number;
    • Get the week year, according to the locale. Different locales assign week numbers (and therefore week years) differently, see localWeekNumber.

    property millisecond

    readonly millisecond: number;
    • Get the millisecond of the second (0-999).

      Example 1

      DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654

    property minute

    readonly minute: number;
    • Get the minute of the hour (0-59).

      Example 1

      DateTime.local(2017, 5, 25, 9, 30).minute //=> 30

    property month

    readonly month: number;
    • Get the month (1-12).

      Example 1

      DateTime.local(2017, 5, 25).month //=> 5

    property monthLong

    readonly monthLong: string;
    • Get the human readable long month name, such as 'October'. Defaults to the system's locale if no locale has been specified

      Example 1

      DateTime.local(2017, 10, 30).monthLong //=> October

    property monthShort

    readonly monthShort: string;
    • Get the human readable short month name, such as 'Oct'. Defaults to the system's locale if no locale has been specified

      Example 1

      DateTime.local(2017, 10, 30).monthShort //=> Oct

    property numberingSystem

    readonly numberingSystem: string;
    • Get the numbering system of a DateTime, such as 'beng'. The numbering system is used when formatting the DateTime

    property offset

    readonly offset: number;
    • Get the UTC offset of this DateTime in minutes

      Example 1

      DateTime.now().offset //=> -240

      Example 2

      DateTime.utc().offset //=> 0

    property offsetNameLong

    readonly offsetNameLong: string;
    • Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time". Defaults to the system's locale if no locale has been specified

    property offsetNameShort

    readonly offsetNameShort: string;
    • Get the short human name for the zone's current offset, for example "EST" or "EDT". Defaults to the system's locale if no locale has been specified

    property ordinal

    readonly ordinal: number;
    • Get the ordinal (meaning the day of the year)

      Example 1

      DateTime.local(2017, 5, 25).ordinal //=> 145

    property outputCalendar

    readonly outputCalendar: string;
    • Get the output calendar of a DateTime, such as 'islamic'. The output calendar is used when formatting the DateTime

    property quarter

    readonly quarter: number;
    • Get the quarter

      Example 1

      DateTime.local(2017, 5, 25).quarter //=> 2

    property second

    readonly second: number;
    • Get the second of the minute (0-59).

      Example 1

      DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52

    property TIME_24_SIMPLE

    static readonly TIME_24_SIMPLE: Intl.DateTimeFormatOptions;

    property TIME_24_WITH_LONG_OFFSET

    static readonly TIME_24_WITH_LONG_OFFSET: Intl.DateTimeFormatOptions;

    property TIME_24_WITH_SECONDS

    static readonly TIME_24_WITH_SECONDS: Intl.DateTimeFormatOptions;

    property TIME_24_WITH_SHORT_OFFSET

    static readonly TIME_24_WITH_SHORT_OFFSET: Intl.DateTimeFormatOptions;

    property TIME_SIMPLE

    static readonly TIME_SIMPLE: Intl.DateTimeFormatOptions;

    property TIME_WITH_LONG_OFFSET

    static readonly TIME_WITH_LONG_OFFSET: Intl.DateTimeFormatOptions;

    property TIME_WITH_SECONDS

    static readonly TIME_WITH_SECONDS: Intl.DateTimeFormatOptions;

    property TIME_WITH_SHORT_OFFSET

    static readonly TIME_WITH_SHORT_OFFSET: Intl.DateTimeFormatOptions;

    property weekday

    readonly weekday: number;
    • Get the day of the week. 1 is Monday and 7 is Sunday

      Example 1

      DateTime.local(2014, 11, 31).weekday //=> 4

      See Also

      • https://en.wikipedia.org/wiki/ISO_week_date

    property weekdayLong

    readonly weekdayLong: string;
    • Get the human readable long weekday, such as 'Monday'. Defaults to the system's locale if no locale has been specified

      Example 1

      DateTime.local(2017, 10, 30).weekdayLong //=> Monday

    property weekdayShort

    readonly weekdayShort: string;
    • Get the human readable short weekday, such as 'Mon'. Defaults to the system's locale if no locale has been specified

      Example 1

      DateTime.local(2017, 10, 30).weekdayShort //=> Mon

    property weekNumber

    readonly weekNumber: number;
    • Get the week number of the week year (1-52ish).

      Example 1

      DateTime.local(2017, 5, 25).weekNumber //=> 21

      See Also

      • https://en.wikipedia.org/wiki/ISO_week_date

    property weeksInLocalWeekYear

    readonly weeksInLocalWeekYear: number;
    • Returns the number of weeks in this DateTime's local week year

      Example 1

      DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52

      Example 2

      DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53

    property weeksInWeekYear

    readonly weeksInWeekYear: number;
    • Returns the number of weeks in this DateTime's year

      Example 1

      DateTime.local(2004).weeksInWeekYear //=> 53

      Example 2

      DateTime.local(2013).weeksInWeekYear //=> 52

      See Also

      • https://en.wikipedia.org/wiki/ISO_week_date

    property weekYear

    readonly weekYear: number;
    • Get the week year

      Example 1

      DateTime.local(2014, 12, 31).weekYear //=> 2015

      See Also

      • https://en.wikipedia.org/wiki/ISO_week_date

    property year

    readonly year: number;
    • Get the year

      Example 1

      DateTime.local(2017, 5, 25).year //=> 2017

    property zone

    readonly zone: Zone<IsValid>;
    • Get the time zone associated with this DateTime.

    property zoneName

    readonly zoneName: string;
    • Get the name of the time zone.

    method diff

    diff: (
    otherDateTime: DateTime,
    unit?: DurationUnits,
    opts?: DiffOptions
    ) => Duration<IsValid>;
    • Return the difference between two DateTimes as a Duration.

      Parameter otherDateTime

      the DateTime to compare this one to

      Parameter unit

      the unit or array of units to include in the duration. Defaults to ['milliseconds'].

      Parameter opts

      options that affect the creation of the Duration

      Parameter

      opts.conversionAccuracy - the conversion system to use. Defaults to 'casual'.

      Example 1

      let i1 = DateTime.fromISO('1982-05-25T09:45'), i2 = DateTime.fromISO('1983-10-14T10:30'); i2.diff(i1).toObject() //=> { milliseconds: 43807500000 } i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 } i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 } i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }

    method diffNow

    diffNow: (unit?: DurationUnits, opts?: DiffOptions) => Duration<Valid>;
    • Return the difference between this DateTime and right now. See DateTime.diff

      Parameter unit

      the unit(s) to include in the duration. Defaults to ['milliseconds'].

      Parameter opts

      options that affect the creation of the Duration

      Parameter

      opts.conversionAccuracy - the conversion system to use. Defaults to 'casual'.

    method endOf

    endOf: (unit: DateTimeUnit, opts?: EndOfOptions) => this;
    • "Set" this DateTime to the end (meaning the last millisecond) of a unit of time

      Parameter unit

      The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.

      Parameter opts

      options

      Example 1

      DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'

      Example 2

      DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'

      Example 3

      DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays

      Example 4

      DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'

      Example 5

      DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'

    method equals

    equals: (other: DateTime) => IfValid<boolean, false, IsValid>;
    • An equality check. Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid. To compare just the millisecond values, use +dt1 === +dt2.

      Parameter other

      the other DateTime

    method expandFormat

    static expandFormat: (fmt: string, localeOpts?: LocaleOptions) => string;
    • Produce the fully expanded format token for the locale Does NOT quote characters, so quoted tokens will not round trip correctly

      Parameter fmt

      the format string

      Parameter localeOpts

      Opts to override the configuration options on this DateTime

    method fromFormat

    static fromFormat: (
    text: string,
    fmt: string,
    opts?: DateTimeOptions
    ) => DateTimeMaybeValid;
    • Create a DateTime from an input string and format string. Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).

      Parameter text

      the string to parse

      Parameter fmt

      the format the string is expected to be in (see the link below for the formats)

      Parameter opts

      options to affect the creation

      Parameter

      opts.zone - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone. Defaults to 'local'.

      Parameter

      opts.setZone - override the zone with a zone specified in the string itself, if it specifies one. Defaults to false.

      Parameter

      opts.locale - a locale string to use when parsing. Will also set the DateTime to this locale. Defaults to 'en-US'.

      Parameter

      opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system

      Parameter

      opts.outputCalendar - the output calendar to set on the resulting DateTime instance

    method fromFormatExplain

    static fromFormatExplain: (
    text: string,
    fmt: string,
    options?: DateTimeOptions
    ) => ExplainedFormat;
    • Explain how a string would be parsed by fromFormat()

      Parameter text

      the string to parse

      Parameter fmt

      the format the string is expected to be in (see description)

      Parameter options

      options taken by fromFormat()

    method fromHTTP

    static fromHTTP: (text: string, opts?: DateTimeOptions) => DateTimeMaybeValid;
    • Create a DateTime from an HTTP header date

      Parameter text

      the HTTP header date

      Parameter opts

      options to affect the creation

      Parameter

      opts.zone - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string,merely the zone the resulting DateTime is expressed in. Defaults to 'local'.

      Parameter

      opts.setZone - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the zone option to 'utc', but this option is included for consistency with similar methods. Defaults to false.

      Parameter

      opts.locale - a locale to set on the resulting DateTime instance. Defaults to 'system's locale'.

      Parameter

      opts.outputCalendar - the output calendar to set on the resulting DateTime instance

      Parameter

      opts.numberingSystem - the numbering system to set on the resulting DateTime instance

      Example 1

      DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')

      Example 2

      DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')

      Example 3

      DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')

      See Also

      • https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1

    method fromISO

    static fromISO: (text: string, opts?: DateTimeOptions) => DateTimeMaybeValid;
    • Create a DateTime from an ISO 8601 string

      Parameter text

      the ISO string

      Parameter opts

      options to affect the creation

      Parameter

      opts.zone - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone. Defaults to 'local'.

      Parameter

      opts.setZone - override the zone with a fixed-offset zone specified in the string itself, if it specifies one. Defaults to false.

      Parameter

      opts.locale - a locale to set on the resulting DateTime instance. Defaults to 'system's locale'.

      Parameter

      opts.outputCalendar - the output calendar to set on the resulting DateTime instance

      Parameter

      opts.numberingSystem - the numbering system to set on the resulting DateTime instance

      Example 1

      DateTime.fromISO('2016-05-25T09:08:34.123')

      Example 2

      DateTime.fromISO('2016-05-25T09:08:34.123+06:00')

      Example 3

      DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})

      Example 4

      DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})

      Example 5

      DateTime.fromISO('2016-W05-4')

    method fromJSDate

    static fromJSDate: (
    date: Date,
    options?: { zone?: string | Zone }
    ) => DateTimeMaybeValid;
    • Create a DateTime from a JavaScript Date object. Uses the default zone.

      Parameter date

      a JavaScript Date object

      Parameter options

      configuration options for the DateTime

      Parameter

      options.zone - the zone to place the DateTime into

    method fromMillis

    static fromMillis: (
    milliseconds: number,
    options?: DateTimeJSOptions
    ) => DateTimeMaybeValid;
    • Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.

      Parameter milliseconds

      a number of milliseconds since 1970 UTC

      Parameter options

      configuration options for the DateTime

      Parameter

      options.zone - the zone to place the DateTime into. Defaults to 'local'.

      Parameter

      options.locale - a locale to set on the resulting DateTime instance

      Parameter

      options.outputCalendar - the output calendar to set on the resulting DateTime instance

      Parameter

      options.numberingSystem - the numbering system to set on the resulting DateTime instance

    method fromObject

    static fromObject: (
    obj: DateObjectUnits,
    opts?: DateTimeJSOptions
    ) => DateTimeMaybeValid;
    • Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.

      Parameter obj

      the object to create the DateTime from

      Parameter

      obj.year - a year, such as 1987

      Parameter

      obj.month - a month, 1-12

      Parameter

      obj.day - a day of the month, 1-31, depending on the month

      Parameter

      obj.ordinal - day of the year, 1-365 or 366

      Parameter

      obj.weekYear - an ISO week year

      Parameter

      obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year

      Parameter

      obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday

      Parameter

      obj.hour - hour of the day, 0-23

      Parameter

      obj.minute - minute of the hour, 0-59

      Parameter

      obj.second - second of the minute, 0-59

      Parameter

      obj.millisecond - millisecond of the second, 0-999

      Parameter opts

      options for creating this DateTime

      Parameter

      opts.zone - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone(). Defaults to 'local'.

      Parameter

      opts.locale - a locale to set on the resulting DateTime instance. Defaults to 'system's locale'.

      Parameter

      opts.outputCalendar - the output calendar to set on the resulting DateTime instance

      Parameter

      opts.numberingSystem - the numbering system to set on the resulting DateTime instance

      Example 1

      DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'

      Example 2

      DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'

      Example 3

      DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //=> today at 10:26:06

      Example 4

      DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' })

      Example 5

      DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })

      Example 6

      DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })

      Example 7

      DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'

      Example 8

      DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: 'en-US' }).toISODate() //=> '2021-12-26'

    method fromRFC2822

    static fromRFC2822: (text: string, opts?: DateTimeOptions) => DateTimeMaybeValid;
    • Create a DateTime from an RFC 2822 string

      Parameter text

      the RFC 2822 string

      Parameter opts

      options to affect the creation

      Parameter

      opts.zone - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. Defaults to 'local'

      Parameter

      opts.setZone - override the zone with a fixed-offset zone specified in the string itself, if it specifies one. Defaults to false.

      Parameter

      opts.locale - a locale to set on the resulting DateTime instance. Defaults to 'system's locale'.

      Parameter

      opts.outputCalendar - the output calendar to set on the resulting DateTime instance

      Parameter

      opts.numberingSystem - the numbering system to set on the resulting DateTime instance

      Example 1

      DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')

      Example 2

      DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')

      Example 3

      DateTime.fromRFC2822('25 Nov 2016 13:23 Z')

    method fromSeconds

    static fromSeconds: (
    seconds: number,
    options?: DateTimeJSOptions
    ) => DateTime<Valid>;
    • Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.

      Parameter seconds

      a number of seconds since 1970 UTC

      Parameter options

      configuration options for the DateTime

      Parameter

      options.zone - the zone to place the DateTime into. Defaults to 'local'.

      Parameter

      options.locale - a locale to set on the resulting DateTime instance

      Parameter

      options.outputCalendar - the output calendar to set on the resulting DateTime instance

      Parameter

      options.numberingSystem - the numbering system to set on the resulting DateTime instance

    method fromSQL

    static fromSQL: (text: string, opts?: DateTimeOptions) => DateTimeMaybeValid;
    • Create a DateTime from a SQL date, time, or datetime Defaults to en-US if no locale has been specified, regardless of the system's locale

      Parameter text

      the string to parse

      Parameter opts

      options to affect the creation

      Parameter

      opts.zone - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone. Defaults to 'local'.

      Parameter

      opts.setZone - override the zone with a zone specified in the string itself, if it specifies one. Defaults to false.

      Parameter

      opts.locale - a locale string to use when parsing. Will also set the DateTime to this locale. Defaults to 'en-US'.

      Parameter

      opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system

      Parameter

      opts.outputCalendar - the output calendar to set on the resulting DateTime instance

      Example 1

      DateTime.fromSQL('2017-05-15')

      Example 2

      DateTime.fromSQL('2017-05-15 09:12:34')

      Example 3

      DateTime.fromSQL('2017-05-15 09:12:34.342')

      Example 4

      DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')

      Example 5

      DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')

      Example 6

      DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })

      Example 7

      DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })

      Example 8

      DateTime.fromSQL('09:12:34.342')

    method fromString

    static fromString: (
    text: string,
    format: string,
    options?: DateTimeOptions
    ) => DateTimeMaybeValid;
    • Deprecated

      use fromFormat instead

    method fromStringExplain

    static fromStringExplain: (
    text: string,
    fmt: string,
    options?: DateTimeOptions
    ) => ExplainedFormat;
    • Deprecated

      use fromFormatExplain instead

    method get

    get: (unit: keyof DateTime) => number;
    • Get the value of unit.

      Parameter unit

      a unit such as 'minute' or 'day'

      Example 1

      DateTime.local(2017, 7, 4).get('month'); //=> 7

      Example 2

      DateTime.local(2017, 7, 4).get('day'); //=> 4

    method getPossibleOffsets

    getPossibleOffsets: () => this[];
    • Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC in this DateTime's zone. During DST changes local time can be ambiguous, for example 2023-10-29T02:30:00 in Europe/Berlin can have offset +01:00 or +02:00. This method will return both possible DateTimes if this DateTime's local time is ambiguous.

    method hasSame

    hasSame: (
    otherDateTime: DateTime,
    unit: DateTimeUnit,
    opts?: HasSameOptions
    ) => IfValid<boolean, false, IsValid>;
    • Return whether this DateTime is in the same unit of time as another DateTime. Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use DateTime.setZone to convert one of the dates if needed.

      Parameter otherDateTime

      the other DateTime

      Parameter unit

      the unit of time to check sameness on

      Example 1

      DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day

    method invalid

    static invalid: (reason: string, explanation?: string) => DateTime<Invalid>;
    • Create an invalid DateTime.

      Parameter reason

      simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent

      Parameter explanation

      longer explanation, may include parameters and other useful debugging information. Defaults to null.

    method isDateTime

    static isDateTime: (o: unknown) => o is DateTime<true> | DateTime<false>;
    • Check if an object is a DateTime. Works across context boundaries

      Parameter o

    method local

    static local: {
    (
    year: number,
    month: number,
    day: number,
    hour: number,
    minute: number,
    second: number,
    millisecond: number,
    opts?: DateTimeJSOptions
    ): DateTimeMaybeValid;
    (
    year: number,
    month: number,
    day: number,
    hour: number,
    minute: number,
    second: number,
    opts?: DateTimeJSOptions
    ): DateTime<true> | DateTime<false>;
    (
    year: number,
    month: number,
    day: number,
    hour: number,
    minute: number,
    opts?: DateTimeJSOptions
    ): DateTime<true> | DateTime<false>;
    (
    year: number,
    month: number,
    day: number,
    hour: number,
    opts?: DateTimeJSOptions
    ): DateTime<true> | DateTime<false>;
    (year: number, month: number, day: number, opts?: DateTimeJSOptions):
    | DateTime<true>
    | DateTime<false>;
    (year: number, month: number, opts?: DateTimeJSOptions):
    | DateTime<true>
    | DateTime<false>;
    (year: number, opts?: DateTimeJSOptions): DateTime<true> | DateTime<false>;
    (opts?: DateTimeJSOptions): DateTime<true>;
    };
    • Create a local DateTime

      Parameter year

      The calendar year. If omitted (as in, call local() with no arguments), the current time will be used

      Parameter month

      The month, 1-indexed

      Parameter day

      The day of the month, 1-indexed

      Parameter hour

      The hour of the day, in 24-hour time

      Parameter minute

      The minute of the hour, meaning a number between 0 and 59

      Parameter second

      The second of the minute, meaning a number between 0 and 59

      Parameter millisecond

      The millisecond of the second, meaning a number between 0 and 999

      Parameter opts

      Example 1

      DateTime.local() //~> now

      Example 2

      DateTime.local({ zone: "America/New_York" }) //~> now, in US east coast time

      Example 3

      DateTime.local(2017) //~> 2017-01-01T00:00:00

      Example 4

      DateTime.local(2017, 3) //~> 2017-03-01T00:00:00

      Example 5

      DateTime.local(2017, 3, 12, { locale: "fr") //~> 2017-03-12T00:00:00, with a French locale

      Example 6

      DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00

      Example 7

      DateTime.local(2017, 3, 12, 5, { zone: "utc" }) //~> 2017-03-12T05:00:00, in UTC

      Example 8

      DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00

      Example 9

      DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10

      Example 10

      DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765

    method max

    static max: <AllValid extends boolean>(
    ...dateTimes: Array<DateTime<AllValid>>
    ) =>
    | (AllValid extends true ? DateTime<Valid> : never)
    | (AllValid extends false ? DateTime<Invalid> : never);
    • Return the max of several date times

      Parameter dateTimes

      the DateTimes from which to choose the maximum

    method min

    static min: <AllValid extends boolean>(
    ...dateTimes: Array<DateTime<AllValid>>
    ) =>
    | (AllValid extends true ? DateTime<Valid> : never)
    | (AllValid extends false ? DateTime<Invalid> : never);
    • Return the min of several date times

      Parameter dateTimes

      the DateTimes from which to choose the minimum

    method minus

    minus: (duration: DurationLike) => this;
    • See DateTime.plus

      Parameter duration

      The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()

    method now

    static now: () => DateTime<Valid>;
    • Create a DateTime for the current instant, in the system's time zone.

      Use Settings to override these default values if needed.

      Example 1

      DateTime.now().toISO() //~> now in the ISO format

    method parseFormatForOpts

    static parseFormatForOpts: (
    formatOpts?: DateTimeFormatOptions,
    localeOpts?: LocaleOptions
    ) => string | null;
    • Produce the format string for a set of options

      Parameter formatOpts

      Intl.DateTimeFormat constructor options and configuration options

      Parameter localeOpts

      Opts to override the configuration options on this DateTime

      Example 1

      DateTime.parseFormatForOpts(DateTime.DATETIME_FULL); //=> "MMMM d, yyyyy, h:m a ZZZ"

    method plus

    plus: (duration: DurationLike) => this;
    • Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, dt.plus({ hours: 24 }) may result in a different time than dt.plus({ days: 1 }) if there's a DST shift in between.

      Parameter duration

      The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()

      Example 1

      DateTime.now().plus(123) //~> in 123 milliseconds

      Example 2

      DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes

      Example 3

      DateTime.now().plus({ days: 1 }) //~> this time tomorrow

      Example 4

      DateTime.now().plus({ days: -1 }) //~> this time yesterday

      Example 5

      DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min

      Example 6

      DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min

    method reconfigure

    reconfigure: (properties: LocaleOptions) => this;
    • "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.

      Parameter properties

      the properties to set

      Example 1

      DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })

    method resolvedLocaleOptions

    resolvedLocaleOptions: (
    opts?: LocaleOptions | DateTimeFormatOptions
    ) => ResolvedLocaleOptions;
    • Returns the resolved Intl options for this DateTime. This is useful in understanding the behavior of formatting methods

      Parameter opts

      the same options as toLocaleString

    method set

    set: (values: DateObjectUnits) => this;
    • "Set" the values of specified units. Returns a newly-constructed DateTime. You can only set units with this method; for "setting" metadata, see DateTime.reconfigure and DateTime.setZone.

      This method also supports setting locale-based week units, i.e. localWeekday, localWeekNumber and localWeekYear. They cannot be mixed with ISO-week units like weekday.

      Example 1

      dt.set({ year: 2017 })

      Example 2

      dt.set({ hour: 8, minute: 30 })

      Example 3

      dt.set({ weekday: 5 })

      Example 4

      dt.set({ year: 2005, ordinal: 234 })

    method setLocale

    setLocale: (locale: string) => this;
    • "Set" the locale. Returns a newly-constructed DateTime. Just a convenient alias for reconfigure({ locale })

      Example 1

      DateTime.local(2017, 5, 25).setLocale('en-GB')

    method setZone

    setZone: (zone?: string | Zone, opts?: ZoneOptions) => DateTimeMaybeValid;
    • "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.

      By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with DateTime.plus. You may wish to use DateTime.toLocal and DateTime.toUTC which provide simple convenience wrappers for commonly used zones.

      Parameter zone

      a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a Zone class. Defaults to 'local'.

      Parameter opts

      options

      Parameter

      opts.keepLocalTime - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this. Defaults to false.

    method startOf

    startOf: (unit: DateTimeUnit, opts?: StartOfOptions) => this;
    • "Set" this DateTime to the beginning of the given unit.

      Parameter unit

      The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.

      Parameter opts

      options

      Example 1

      DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'

      Example 2

      DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'

      Example 3

      DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays

      Example 4

      DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'

      Example 5

      DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'

    method toBSON

    toBSON: () => Date;
    • Returns a BSON-serializable equivalent to this DateTime.

    method toFormat

    toFormat: (
    fmt: string,
    opts?: LocaleOptions
    ) => IfValid<string, 'Invalid DateTime', IsValid>;
    • Returns a string representation of this DateTime formatted according to the specified format string. **You may not want this.** See DateTime.toLocaleString for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens). Defaults to en-US if no locale has been specified, regardless of the system's locale.

      Parameter fmt

      the format string

      Parameter opts

      opts to override the configuration options on this DateTime

      Example 1

      DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'

      Example 2

      DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'

      Example 3

      DateTime.now().toFormat('yyyy LLL dd', { locale: "fr" }) //=> '2017 avr. 22'

      Example 4

      DateTime.now().toFormat("HH 'hours and' mm 'minutes'") //=> '20 hours and 55 minutes'

    method toHTTP

    toHTTP: () => IfValid<string, null, IsValid>;
    • Returns a string representation of this DateTime appropriate for use in HTTP headers. Specifically, the string conforms to RFC 1123.

      Example 1

      DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'

      Example 2

      DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'

      See Also

      • https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1

    method toISO

    toISO: (opts?: ToISOTimeOptions) => IfValid<string, null, IsValid>;
    • Returns an ISO 8601-compliant string representation of this DateTime

      Example 1

      DateTime.utc(1982, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'

      Example 2

      DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'

      Example 3

      DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'

      Example 4

      DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'

    method toISODate

    toISODate: (opts?: ToISODateOptions) => IfValid<string, null, IsValid>;
    • Returns an ISO 8601-compliant string representation of this DateTime's date component

      Parameter opts

      options

      Parameter

      opts.format - choose between the basic and extended format. Defaults to 'extended'.

      Example 1

      DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'

      Example 2

      DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'

    method toISOTime

    toISOTime: (opts?: ToISOTimeOptions) => IfValid<string, null, IsValid>;
    • Returns an ISO 8601-compliant string representation of this DateTime's time component

      Parameter opts

      options

      Parameter

      opts.suppressMilliseconds - exclude milliseconds from the format if they're 0. Defaults to false.

      Parameter

      opts.suppressSeconds - exclude seconds from the format if they're 0. Defaults to false.

      Parameter

      opts.includeOffset - include the offset, such as 'Z' or '-04:00'. Defaults to true.

      Parameter

      opts.includePrefix - include the T prefix. Defaults to false.

      Parameter

      opts.format - choose between the basic and extended format. Defaults to 'extended'.

      Example 1

      DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'

      Example 2

      DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'

      Example 3

      DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'

      Example 4

      DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'

    method toISOWeekDate

    toISOWeekDate: () => IfValid<string, null, IsValid>;
    • Returns an ISO 8601-compliant string representation of this DateTime's week date

      Example 1

      DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'

    method toJSDate

    toJSDate: () => Date;
    • Returns a JavaScript Date equivalent to this DateTime.

    method toJSON

    toJSON: () => IfValid<string, null, IsValid>;
    • Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.

    method toLocal

    toLocal: () => this;
    • "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.

      Equivalent to setZone('local')

    method toLocaleParts

    toLocaleParts: (opts?: DateTimeFormatOptions) => Intl.DateTimeFormatPart[];
    • Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output. Defaults to the system's locale if no locale has been specified

      Example 1

      DateTime.now().toLocaleParts(); //=> [ //=> { type: 'day', value: '25' }, //=> { type: 'literal', value: '/' }, //=> { type: 'month', value: '05' }, //=> { type: 'literal', value: '/' }, //=> { type: 'year', value: '1982' } //=> ]

      Example 2

      DateTime.invalid('').toLocaleParts(); //=> []

      See Also

      • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts

    method toLocaleString

    toLocaleString: (
    formatOpts?: DateTimeFormatOptions,
    opts?: LocaleOptions
    ) => IfValid<string, 'Invalid DateTime', IsValid>;
    • Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as DateTime.DATE_FULL or DateTime.TIME_SIMPLE of the DateTime in the assigned locale. Defaults to the system's locale if no locale has been specified

      Parameter formatOpts

      Intl.DateTimeFormat constructor options and configuration options

      Parameter opts

      opts to override the configuration options on this DateTime

      Example 1

      DateTime.now().toLocaleString(); //=> 4/20/2017

      Example 2

      DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'

      Example 3

      DateTime.now().toLocaleString({ locale: 'en-gb' }); //=> '20/04/2017'

      Example 4

      DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'

      Example 5

      DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'

      Example 6

      DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'

      Example 7

      DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'

      Example 8

      DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'

      Example 9

      DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'

      See Also

      • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat

    method toMillis

    toMillis: () => IfValid<number, typeof NaN, IsValid>;
    • Returns the epoch milliseconds of this DateTime.

    method toObject

    toObject: <IncludeConfig extends boolean>(opts?: {
    includeConfig?: IncludeConfig;
    }) => ToObjectOutput<IncludeConfig, IsValid>;
    • Returns a JavaScript object with this DateTime's year, month, day, and so on.

      Parameter opts

      options for generating the object

      Parameter

      opts.includeConfig - include configuration attributes in the output. Defaults to false.

      Example 1

      DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }

    method toRelative

    toRelative: (options?: ToRelativeOptions) => IfValid<string, null, IsValid>;
    • Returns a string representation of this time relative to now, such as "in two days". Can only internationalize if your platform supports Intl.RelativeTimeFormat. Rounds down by default.

      Example 1

      DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day"

      Example 2

      DateTime.now().setLocale("es").toRelative({ days: 1 }) //=> "dentro de 1 día"

      Example 3

      DateTime.now().plus({ days: 1 }).toRelative({ locale: "fr" }) //=> "dans 23 heures"

      Example 4

      DateTime.now().minus({ days: 2 }).toRelative() //=> "2 days ago"

      Example 5

      DateTime.now().minus({ days: 2 }).toRelative({ unit: "hours" }) //=> "48 hours ago"

      Example 6

      DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago"

    method toRelativeCalendar

    toRelativeCalendar: (
    options?: ToRelativeCalendarOptions
    ) => IfValid<string, null, IsValid>;
    • Returns a string representation of this date relative to today, such as "yesterday" or "next month". Only internationalizes on platforms that support Intl.RelativeTimeFormat.

      Example 1

      DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> "tomorrow"

      Example 2

      DateTime.now().setLocale("es").plus({ days: 1 }).toRelative() //=> ""mañana"

      Example 3

      DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) //=> "demain"

      Example 4

      DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago"

    method toRFC2822

    toRFC2822: () => IfValid<string, null, IsValid>;
    • Returns an RFC 2822-compatible string representation of this DateTime, always in UTC

      Example 1

      DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'

      Example 2

      DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'

    method toSeconds

    toSeconds: () => IfValid<number, typeof NaN, IsValid>;
    • Returns the epoch seconds of this DateTime.

    method toSQL

    toSQL: (opts?: ToSQLOptions) => IfValid<string, null, IsValid>;
    • Returns a string representation of this DateTime for use in SQL DateTime

      Example 1

      DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'

      Example 2

      DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'

      Example 3

      DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'

      Example 4

      DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'

    method toSQLDate

    toSQLDate: () => IfValid<string, null, IsValid>;
    • Returns a string representation of this DateTime appropriate for use in SQL Date

      Example 1

      DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'

    method toSQLTime

    toSQLTime: (opts?: ToSQLOptions) => IfValid<string, null, IsValid>;
    • Returns a string representation of this DateTime appropriate for use in SQL Time

      Example 1

      DateTime.utc().toSQL() //=> '05:15:16.345'

      Example 2

      DateTime.now().toSQL() //=> '05:15:16.345 -04:00'

      Example 3

      DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'

      Example 4

      DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'

    method toString

    toString: () => IfValid<string, 'Invalid DateTime', IsValid>;
    • Returns a string representation of this DateTime appropriate for debugging

    method toUnixInteger

    toUnixInteger: () => IfValid<number, typeof NaN, IsValid>;
    • Returns the epoch seconds (as a whole number) of this DateTime.

    method toUTC

    toUTC: (offset?: number, opts?: ZoneOptions) => this;
    • "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime.

      Equivalent to DateTime.setZone('utc')

      Parameter offset

      optionally, an offset from UTC in minutes. Defaults to 0.

      Parameter opts

      options to pass to setZone(). Defaults to {}.

    method until

    until: (
    otherDateTime: DateTime
    ) => IfValid<Interval<Valid>, DateTime<Invalid>, IsValid>;
    • Return an Interval spanning between this DateTime and another DateTime

      Parameter otherDateTime

      the other end point of the Interval

    method utc

    static utc: {
    (
    year: number,
    month: number,
    day: number,
    hour: number,
    minute: number,
    second: number,
    millisecond: number,
    options?: LocaleOptions
    ): DateTimeMaybeValid;
    (
    year: number,
    month: number,
    day: number,
    hour: number,
    minute: number,
    second: number,
    options?: LocaleOptions
    ): DateTime<true> | DateTime<false>;
    (
    year: number,
    month: number,
    day: number,
    hour: number,
    minute: number,
    options?: LocaleOptions
    ): DateTime<true> | DateTime<false>;
    (
    year: number,
    month: number,
    day: number,
    hour: number,
    options?: LocaleOptions
    ): DateTime<true> | DateTime<false>;
    (year: number, month: number, day: number, options?: LocaleOptions):
    | DateTime<true>
    | DateTime<false>;
    (year: number, month: number, options?: LocaleOptions):
    | DateTime<true>
    | DateTime<false>;
    (year: number, options?: LocaleOptions): DateTime<true> | DateTime<false>;
    (options?: LocaleOptions): DateTime<true>;
    };
    • Create a DateTime in UTC

      Parameter year

      The calendar year. If omitted (as in, call utc() with no arguments), the current time will be used

      Parameter month

      The month, 1-indexed

      Parameter day

      The day of the month

      Parameter hour

      The hour of the day, in 24-hour time

      Parameter minute

      The minute of the hour, meaning a number between 0 and 59

      Parameter second

      The second of the minute, meaning a number between 0 and 59

      Parameter millisecond

      The millisecond of the second, meaning a number between 0 and 999

      Parameter options

      configuration options for the DateTime

      Parameter

      options.locale - a locale to set on the resulting DateTime instance

      Parameter

      options.outputCalendar - the output calendar to set on the resulting DateTime instance

      Parameter

      options.numberingSystem - the numbering system to set on the resulting DateTime instance

      Example 1

      DateTime.utc() //~> now

      Example 2

      DateTime.utc(2017) //~> 2017-01-01T00:00:00Z

      Example 3

      DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z

      Example 4

      DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z

      Example 5

      DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z

      Example 6

      DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z

      Example 7

      DateTime.utc(2017, 3, 12, 5, 45, { locale: "fr" } ) //~> 2017-03-12T05:45:00Z with a French locale

      Example 8

      DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z

      Example 9

      DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: "fr") //~> 2017-03-12T05:45:10.765Z with a French locale

    method valueOf

    valueOf: () => IfValid<number, typeof NaN, IsValid>;

    class Duration

    class Duration<IsValid extends boolean = DefaultValidity> {}

    property days

    readonly days: number;
    • Get the days.

    property hours

    readonly hours: number;
    • Get the hours.

    property invalidExplanation

    readonly invalidExplanation: string;
    • Returns an explanation of why this Duration became invalid, or null if the Duration is valid

    property invalidReason

    readonly invalidReason: string;
    • Returns an error code if this Duration became invalid, or null if the Duration is valid

    property isValid

    readonly isValid: boolean;
    • Returns whether the Duration is invalid. Diff operations on invalid DateTimes or Intervals return invalid Durations.

    property locale

    readonly locale: string;
    • Get the locale of a Duration, such as 'en-GB'

    property milliseconds

    readonly milliseconds: number;
    • Get the milliseconds.

    property minutes

    readonly minutes: number;
    • Get the minutes.

    property months

    readonly months: number;
    • Get the months.

    property numberingSystem

    readonly numberingSystem: string;
    • Get the numbering system of a Duration, such as 'beng'. The numbering system is used when formatting the Duration

    property quarters

    readonly quarters: number;
    • Get the quarters.

    property seconds

    readonly seconds: number;
    • Get the seconds.

    property weeks

    readonly weeks: number;
    • Get the weeks

    property years

    readonly years: number;
    • Get the years.

    method as

    as: (unit: DurationUnit) => IfValid<number, typeof NaN, IsValid>;
    • Return the length of the duration in the specified unit.

      Parameter unit

      a unit such as 'minutes' or 'days'

      Example 1

      Duration.fromObject({years: 1}).as('days') //=> 365

      Example 2

      Duration.fromObject({years: 1}).as('months') //=> 12

      Example 3

      Duration.fromObject({hours: 60}).as('days') //=> 2.5

    method equals

    equals: (other: Duration) => IfValid<boolean, false, IsValid>;
    • Equality check Two Durations are equal iff they have the same units and the same values for each unit.

    method fromDurationLike

    static fromDurationLike: (durationLike: DurationLike) => Duration<Valid>;
    • Create a Duration from DurationLike.

      Parameter durationLike

      Either a Luxon Duration, a number of milliseconds, or the object argument to Duration.fromObject()

    method fromISO

    static fromISO: (text: string, opts?: DurationOptions) => DurationMaybeValid;
    • Create a Duration from an ISO 8601 duration string.

      Parameter text

      text to parse

      Parameter opts

      options for parsing

      Parameter

      opts.locale - the locale to use. Defaults to 'en-US'.

      Parameter

      opts.numberingSystem - the numbering system to use

      Parameter

      opts.conversionAccuracy - the conversion system to use. Defaults to 'casual'.

      Example 1

      Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }

      Example 2

      Duration.fromISO('PT23H').toObject() //=> { hours: 23 }

      Example 3

      Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }

      See Also

      • https://en.wikipedia.org/wiki/ISO_8601#Durations

    method fromISOTime

    static fromISOTime: (text: string, opts?: DurationOptions) => DurationMaybeValid;
    • Create a Duration from an ISO 8601 time string.

      Parameter text

      text to parse

      Parameter opts

      options for parsing

      Parameter

      opts.locale - the locale to use. Defaults to 'en-US'.

      Parameter

      opts.numberingSystem - the numbering system to use

      Parameter

      opts.conversionAccuracy - the conversion system to use. Defaults to 'casual'.

      Example 1

      Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }

      Example 2

      Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }

      Example 3

      Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }

      Example 4

      Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }

      Example 5

      Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }

      See Also

      • https://en.wikipedia.org/wiki/ISO_8601#Times

    method fromMillis

    static fromMillis: (count: number, opts?: DurationOptions) => Duration<Valid>;
    • Create Duration from a number of milliseconds.

      Parameter count

      of milliseconds

      Parameter opts

      options for parsing

      Parameter

      opts.locale - the locale to use

      Parameter

      opts.numberingSystem - the numbering system to use

      Parameter

      opts.conversionAccuracy - the conversion system to use

    method fromObject

    static fromObject: (
    obj: DurationLikeObject,
    opts?: DurationOptions
    ) => Duration<Valid>;
    • Create a Duration from a JavaScript object with keys like 'years' and 'hours'. If this object is empty then a zero milliseconds duration is returned.

      Parameter obj

      the object to create the Duration from

      Parameter

      obj.years

      Parameter

      obj.quarters

      Parameter

      obj.months

      Parameter

      obj.weeks

      Parameter

      obj.days

      Parameter

      obj.hours

      Parameter

      obj.minutes

      Parameter

      obj.seconds

      Parameter

      obj.milliseconds

      Parameter opts

      options for creating this Duration. Defaults to {}.

      Parameter

      opts.locale - the locale to use. Defaults to 'en-US'.

      Parameter

      opts.numberingSystem - the numbering system to use

      Parameter

      opts.conversionAccuracy - the conversion system to use. Defaults to 'casual'.

    method get

    get: (unit: DurationUnit) => IfValid<number, typeof NaN, IsValid>;
    • Get the value of unit.

      Parameter unit

      a unit such as 'minute' or 'day'

      Example 1

      Duration.fromObject({years: 2, days: 3}).get('years') //=> 2

      Example 2

      Duration.fromObject({years: 2, days: 3}).get('months') //=> 0

      Example 3

      Duration.fromObject({years: 2, days: 3}).get('days') //=> 3

    method invalid

    static invalid: (reason: string, explanation?: string) => Duration<Invalid>;
    • Create an invalid Duration.

      Parameter reason

      simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent

      Parameter explanation

      longer explanation, may include parameters and other useful debugging information. Defaults to null.

    method isDuration

    static isDuration: (o: unknown) => o is Duration<true> | Duration<false>;
    • Check if an object is a Duration. Works across context boundaries

      Parameter o

    method mapUnits

    mapUnits: (fn: (x: number, u?: DurationUnit) => number) => this;
    • Scale this Duration by the specified amount. Return a newly-constructed Duration.

      Example 1

      Duration.fromObject({ hours: 1, minutes: 30 }).mapUnit(x => x * 2) //=> { hours: 2, minutes: 60 }

      Example 2

      Duration.fromObject({ hours: 1, minutes: 30 }).mapUnit((x, u) => u === "hour" ? x * 2 : x) //=> { hours: 2, minutes: 30 }

    method minus

    minus: (duration: DurationLike) => this;
    • Make this Duration shorter by the specified amount. Return a newly-constructed Duration.

      Parameter duration

      The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()

    method negate

    negate: () => this;
    • Return the negative of this Duration.

      Example 1

      Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }

    method normalize

    normalize: () => this;
    • Reduce this Duration to its canonical representation in its current units.

      Example 1

      Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }

      Example 2

      Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }

    method plus

    plus: (duration: DurationLike) => this;
    • Make this Duration longer by the specified amount. Return a newly-constructed Duration.

      Parameter duration

      The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()

    method reconfigure

    reconfigure: (opts?: DurationOptions) => this;
    • "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration.

      Example 1

      dur.reconfigure({ locale: 'en-GB' })

    method rescale

    rescale: () => this;
    • Rescale units to its largest representation.

      Example 1

      Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }

    method set

    set: (values: DurationLikeObject) => this;
    • "Set" the values of specified units. Return a newly-constructed Duration.

      Parameter values

      a mapping of units to numbers

      Example 1

      dur.set({ years: 2017 })

      Example 2

      dur.set({ hours: 8, minutes: 30 })

    method shiftTo

    shiftTo: (...units: DurationUnit[]) => this;
    • Convert this Duration into its representation in a different set of units.

      Example 1

      Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }

    method shiftToAll

    shiftToAll: () => this;
    • Shift this Duration to all available units. Same as shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds")

    method toFormat

    toFormat: (
    fmt: string,
    opts?: { floor?: boolean | undefined }
    ) => IfValid<string, 'Invalid Duration', IsValid>;
    • Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens: * S for milliseconds * s for seconds * m for minutes * h for hours * d for days * M for months * y for years Notes: * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits * The duration will be converted to the set of units in the format string using Duration.shiftTo and the Duration's conversion accuracy setting.

      Parameter fmt

      the format string

      Parameter opts

      options

      Parameter

      opts.floor - floor numerical values. Defaults to true.

      Example 1

      Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2"

      Example 2

      Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002"

      Example 3

      Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000"

    method toHuman

    toHuman: (opts?: ToHumanDurationOptions) => string;
    • Returns a string representation of a Duration with all units included To modify its behavior use the listStyle and any Intl.NumberFormat option, though unitDisplay is especially relevant. See Intl.NumberFormat.

      Example 1

      var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })
      dur.toHuman() //=> '1 day, 5 hours, 6 minutes'
      dur.toHuman({ listStyle: "long" }) //=> '1 day, 5 hours, and 6 minutes'
      dur.toHuman({ unitDisplay: "short" }) //=> '1 day, 5 hr, 6 min'

    method toISO

    toISO: () => IfValid<string, null, IsValid>;
    • Returns an ISO 8601-compliant string representation of this Duration.

      Example 1

      Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'

      Example 2

      Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'

      Example 3

      Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'

      Example 4

      Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'

      Example 5

      Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'

      See Also

      • https://en.wikipedia.org/wiki/ISO_8601#Durations

    method toISOTime

    toISOTime: (opts?: ToISOTimeDurationOptions) => IfValid<string, null, IsValid>;
    • Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.

      Parameter opts

      options

      Parameter

      opts.suppressMilliseconds - exclude milliseconds from the format if they are 0. Defaults to false.

      Parameter

      opts.suppressSeconds - exclude seconds from the format if they're 0. Defaults to false.

      Parameter

      opts.includePrefix - include the T prefix. Defaults to false.

      Parameter

      opts.format - choose between the basic and extended format. Defaults to 'extended'.

      Example 1

      Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'

      Example 2

      Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'

      Example 3

      Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'

      Example 4

      Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'

      Example 5

      Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'

      See Also

      • https://en.wikipedia.org/wiki/ISO_8601#Times

    method toJSON

    toJSON: () => IfValid<string, null, IsValid>;
    • Returns an ISO 8601 representation of this Duration appropriate for use in JSON.

    method toMillis

    toMillis: () => IfValid<number, typeof NaN, IsValid>;
    • Returns a millisecond value of this Duration.

    method toObject

    toObject: () => DurationObjectUnits;
    • Returns a JavaScript object with this Duration's values.

      Example 1

      Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }

    method toString

    toString: () => IfValid<string, null, IsValid>;
    • Returns an ISO 8601 representation of this Duration appropriate for use in debugging.

    method valueOf

    valueOf: () => IfValid<number, typeof NaN, IsValid>;
    • Returns a millisecond value of this Duration. Alias of toMillis

    class FixedOffsetZone

    class FixedOffsetZone extends Zone<true> {}
    • A zone with a fixed offset (meaning no DST)

    property utcInstance

    static readonly utcInstance: FixedOffsetZone;
    • Get a singleton instance of UTC

    method instance

    static instance: (offset: number) => FixedOffsetZone;
    • Get an instance with a specified offset

      Parameter offset

      The offset in minutes

    method parseSpecifier

    static parseSpecifier: (s: string) => FixedOffsetZone;
    • Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6"

      Parameter s

      The offset string to parse

      Example 1

      FixedOffsetZone.parseSpecifier("UTC+6")

      Example 2

      FixedOffsetZone.parseSpecifier("UTC+06")

      Example 3

      FixedOffsetZone.parseSpecifier("UTC-6:00")

    class IANAZone

    class IANAZone<IsValid extends boolean = DefaultValidity> extends Zone<IsValid> {}
    • A zone identified by an IANA identifier, like America/New_York

    constructor

    constructor(name: string);

      method create

      static create: (
      name: string
      ) => CanBeInvalid extends true ? IANAZone<true> | IANAZone<false> : IANAZone;
      • Same as constructor but has caching.

      method isValidSpecifier

      static isValidSpecifier: (s: string) => boolean;
      • Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.

        Parameter s

        The string to check validity on

        Example 1

        IANAZone.isValidSpecifier("America/New_York") //=> true

        Example 2

        IANAZone.isValidSpecifier("Fantasia/Castle") //=> true

        Example 3

        IANAZone.isValidSpecifier("Sport~~blorp") //=> false

      method isValidZone

      static isValidZone: (zone: string) => boolean;
      • Returns whether the provided string identifies a real zone

        Parameter zone

        The string to check

        Example 1

        IANAZone.isValidZone("America/New_York") //=> true

        Example 2

        IANAZone.isValidZone("Fantasia/Castle") //=> false

        Example 3

        IANAZone.isValidZone("Sport~~blorp") //=> false

      method resetCache

      static resetCache: () => void;
      • Reset local caches. Should only be necessary in testing scenarios.

      class Interval

      class Interval<IsValid extends boolean = DefaultValidity> {}

      property end

      readonly end: DateTime<true>;
      • Returns the end of the Interval

      property invalidExplanation

      readonly invalidExplanation: string;
      • Returns an explanation of why this Interval became invalid, or null if the Interval is valid

      property invalidReason

      readonly invalidReason: string;
      • Returns an error code if this Interval is invalid, or null if the Interval is valid

      property isValid

      readonly isValid: boolean;
      • Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.

      property start

      readonly start: DateTime<true>;
      • Returns the start of the Interval

      method abutsEnd

      abutsEnd: (other: Interval) => IfValid<boolean, false, IsValid>;
      • Return whether this Interval's start is adjacent to the specified Interval's end.

      method abutsStart

      abutsStart: (other: Interval) => IfValid<boolean, false, IsValid>;
      • Return whether this Interval's end is adjacent to the specified Interval's start.

      method after

      static after: (start: DateInput, duration: DurationLike) => IntervalMaybeValid;
      • Create an Interval from a start DateTime and a Duration to extend to.

        Parameter start

        Parameter duration

        the length of the Interval.

      method before

      static before: (end: DateInput, duration: DurationLike) => IntervalMaybeValid;
      • Create an Interval from an end DateTime and a Duration to extend backwards to.

        Parameter end

        Parameter duration

        the length of the Interval.

      method contains

      contains: (dateTime: DateTime) => IfValid<boolean, false, IsValid>;
      • Return whether this Interval contains the specified DateTime.

        Parameter dateTime

      method count

      count: (
      unit?: DurationUnit,
      opts?: CountOptions
      ) => IfValid<number, typeof NaN, IsValid>;
      • Returns the count of minutes, hours, days, months, or years included in the Interval, even in part. Unlike Interval#length this counts sections of the calendar, not periods of time, e.g. specifying 'day' asks 'what dates are included in this interval?', not 'how many days long is this interval?'

        Parameter unit

        the unit of time to count. Defaults to 'milliseconds'.

      method difference

      difference: (...intervals: Interval[]) => IntervalMaybeValid[];
      • Return Intervals representing the spans of time in this Interval that not overlap with any of the specified Intervals.

      method divideEqually

      divideEqually: (numberOfParts: number) => IfValid<Interval[], [], IsValid>;
      • Split this Interval into the specified number of smaller intervals.

        Parameter numberOfParts

        The number of Intervals to divide the Interval into.

      method engulfs

      engulfs: (other: Interval) => IfValid<boolean, false, IsValid>;
      • Return whether this Interval engulfs the start and end of the specified Interval.

      method equals

      equals: (other: Interval) => IfValid<boolean, false, IsValid>;
      • Return whether this Interval has the same start and end as the specified Interval.

      method fromDateTimes

      static fromDateTimes: (start: DateInput, end: DateInput) => IntervalMaybeValid;
      • Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.

        Parameter start

        Parameter end

      method fromISO

      static fromISO: (text: string, opts?: DateTimeOptions) => IntervalMaybeValid;
      • Create an Interval from an ISO 8601 string. Accepts <start>/<end>, <start>/<duration>, and <duration>/<end> formats.

        Parameter text

        the ISO string to parse

        Parameter opts

        options to pass DateTime.fromISO and optionally Duration.fromISO

        See Also

        • https://en.wikipedia.org/wiki/ISO_8601#Time_intervals

      method hasSame

      hasSame: (unit: DurationUnit) => IfValid<boolean, false, IsValid>;
      • Returns whether this Interval's start and end are both in the same unit of time

        Parameter unit

        the unit of time to check sameness on

      method intersection

      intersection: (other: Interval) => Interval | null;
      • Return an Interval representing the intersection of this Interval and the specified Interval. Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals. Returns null if the intersection is empty, meaning the intervals do not intersect.

      method invalid

      static invalid: (reason: string, explanation?: string) => Interval<Invalid>;
      • Create an invalid Interval.

        Parameter reason

        simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent

        Parameter explanation

        longer explanation, may include parameters and other useful debugging information.

      method isAfter

      isAfter: (dateTime: DateTime) => IfValid<boolean, false, IsValid>;
      • Return whether this Interval's start is after the specified DateTime.

        Parameter dateTime

      method isBefore

      isBefore: (dateTime: DateTime) => IfValid<boolean, false, IsValid>;
      • Return whether this Interval's end is before the specified DateTime.

        Parameter dateTime

      method isEmpty

      isEmpty: () => boolean;
      • Return whether this Interval has the same start and end DateTimes.

      method isInterval

      static isInterval: (o: unknown) => o is Interval<true> | Interval<false>;
      • Check if an object is an Interval. Works across context boundaries

        Parameter o

      method length

      length: (unit?: DurationUnit) => IfValid<number, typeof NaN, IsValid>;
      • Returns the length of the Interval in the specified unit.

        Parameter unit

        the unit (such as 'hours' or 'days') to return the length in.

      method mapEndpoints

      mapEndpoints: (mapFn: (d: DateTime) => DateTime) => IntervalMaybeValid;
      • Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes

        Example 1

        Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())

        Example 2

        Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))

      method merge

      static merge: (intervals: Interval[]) => IntervalMaybeValid[];
      • Merge an array of Intervals into an equivalent minimal set of Intervals. Combines overlapping and adjacent Intervals.

      method overlaps

      overlaps: (other: Interval) => boolean;
      • Return whether this Interval overlaps with the specified Interval

      method set

      set: (values?: IntervalObject) => IntervalMaybeValid;
      • "Sets" the start and/or end dates. Returns a newly-constructed Interval.

        Parameter values

        the values to set

        Parameter

        values.start - the starting DateTime

        Parameter

        values.end - the ending DateTime

      method splitAt

      splitAt: (...dateTimes: DateTime[]) => IfValid<Interval[], [], IsValid>;
      • Split this Interval at each of the specified DateTimes

        Parameter dateTimes

        the unit of time to count.

      method splitBy

      splitBy: (duration: DurationLike) => IfValid<Interval[], [], IsValid>;
      • Split this Interval into smaller Intervals, each of the specified length. Left over time is grouped into a smaller interval

        Parameter duration

        The length of each resulting interval.

      method toDuration

      toDuration: (
      unit?: DurationUnit | DurationUnit[],
      opts?: DiffOptions
      ) => DurationMaybeValid;
      • Return a Duration representing the time spanned by this interval.

        Parameter unit

        the unit or units (such as 'hours' or 'days') to include in the duration. Defaults to ['milliseconds'].

        Parameter opts

        options that affect the creation of the Duration

        Parameter

        opts.conversionAccuracy - the conversion system to use. Defaults to 'casual'.

        Example 1

        Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }

        Example 2

        Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }

        Example 3

        Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }

        Example 4

        Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }

        Example 5

        Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }

      method toFormat

      toFormat: (
      dateFormat: string,
      opts?: { separator?: string | undefined }
      ) => IfValid<string, 'Invalid Interval', IsValid>;
      • Returns a string representation of this Interval formatted according to the specified format string.

        Parameter dateFormat

        the format string. This string formats the start and end time. See DateTime.toFormat for details.

        Parameter opts

        options

        Parameter

        opts.separator - a separator to place between the start and end representations. Defaults to ' - '.

      method toISO

      toISO: (opts?: ToISOTimeOptions) => IfValid<string, 'Invalid Interval', IsValid>;
      • Returns an ISO 8601-compliant string representation of this Interval.

        Parameter opts

        The same options as DateTime#toISO

        See Also

        • https://en.wikipedia.org/wiki/ISO_8601#Time_intervals

      method toISODate

      toISODate: () => IfValid<string, 'Invalid Interval', IsValid>;
      • Returns an ISO 8601-compliant string representation of the dates in this Interval. The time components are ignored.

        See Also

        • https://en.wikipedia.org/wiki/ISO_8601#Time_intervals

      method toISOTime

      toISOTime: (
      opts?: ToISOTimeOptions
      ) => IfValid<string, 'Invalid Interval', IsValid>;
      • Returns an ISO 8601-compliant string representation of the times in this Interval. The date components are ignored.

        Parameter opts

        The same options as DateTime.toISO

        See Also

        • https://en.wikipedia.org/wiki/ISO_8601#Time_intervals

      method toLocaleString

      toLocaleString: (
      formatOpts?: Intl.DateTimeFormatOptions,
      opts?: LocaleOptions
      ) => IfValid<string, 'Invalid Interval', IsValid>;
      • Returns a localized string representing this Interval. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as DateTime.DATE_FULL or DateTime.TIME_SIMPLE. The exact behavior of this method is browser-specific, but in general it will return an appropriate representation of the Interval in the assigned locale. Defaults to the system's locale if no locale has been specified.

        Parameter formatOpts

        Either a DateTime preset or Intl.DateTimeFormat constructor options. Defaults to DateTime.DATE_SHORT

        Parameter opts

        Options to override the configuration of the start DateTime.

        Example 1

        Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022

        Example 2

        Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022

        Example 3

        Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022

        Example 4

        Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM

        Example 5

        Interval.fromISO("2022-11-07T17:00Z/2022-11-07T19:00Z").toLocaleString({ weekday: "short", month: "short", day: "2-digit", hour: "2-digit", minute: "2-digit", }); //=> Mon, Nov 07, 6:00 – 8:00 p

        See Also

        • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat

      method toString

      toString: () => IfValid<string, 'Invalid Interval', IsValid>;
      • Returns a string representation of this Interval appropriate for debugging.

      method union

      union: (other: Interval) => IntervalMaybeValid;
      • Return an Interval representing the union of this Interval and the specified Interval. Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.

      method xor

      static xor: (intervals: Interval[]) => IntervalMaybeValid[];
      • Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.

      class InvalidZone

      class InvalidZone extends Zone<false> {}
      • A zone that failed to parse. You should never need to instantiate this.

      property isUniversal

      readonly isUniversal: boolean;

        property offsetFormat

        readonly offsetFormat: string;

          property type

          readonly type: string;

            class Settings

            class Settings {}
            • Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.

            property defaultLocale

            static defaultLocale: string;
            • The default locale to create DateTimes with. Does not affect existing instances.

            property defaultNumberingSystem

            static defaultNumberingSystem: string;
            • The default numbering system to create DateTimes with. Does not affect existing instances.

            property defaultOutputCalendar

            static defaultOutputCalendar: string;
            • The default output calendar to create DateTimes with. Does not affect existing instances.

            property defaultWeekSettings

            static defaultWeekSettings: WeekSettings;
            • Allows overriding the default locale week settings, i.e. the start of the week, the weekend and how many days are required in the first week of a year. Does not affect existing instances.

            property defaultZone

            static defaultZone: Zone<true> | Zone<false>;
            • The default time zone object currently used to create DateTimes. Does not affect existing instances. The default value is the system's time zone (the one set on the machine that runs this code).

            property now

            static now: () => number;
            • Get the callback for returning the current timestamp.

            property throwOnInvalid

            static throwOnInvalid: boolean;
            • Whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals

              If setting this to true, be sure to opt-out of Luxon's invalid return types.

              Example 1

              Settings.throwOnInvalid = true; declare module 'luxon' { interface TSSettings { throwOnInvalid: true; } }

            property twoDigitCutoffYear

            static twoDigitCutoffYear: number;
            • The cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.

            method resetCaches

            static resetCaches: () => void;
            • Reset Luxon's global caches. Should only be necessary in testing scenarios.

            class SystemZone

            class SystemZone extends Zone<true> {}
            • Represents the system zone for this JavaScript environment.

            property instance

            static readonly instance: SystemZone;
            • Get a singleton instance of the system zone

            class Zone

            abstract class Zone<IsValid extends boolean = DefaultValidity> {}

              property isUniversal

              readonly isUniversal: boolean;
              • Returns whether the offset is known to be fixed for the whole year.

              property isValid

              readonly isValid: boolean;
              • Return whether this Zone is valid.

              property name

              readonly name: string;
              • The name of this zone.

              property type

              readonly type: string;
              • The type of zone

              method equals

              equals: (other: Zone) => IfValid<boolean, false, IsValid>;
              • Return whether this Zone is equal to another zone

                Parameter other

                the zone to compare

              method formatOffset

              formatOffset: (
              ts: number,
              format: ZoneOffsetFormat
              ) => IfValid<string, '', IsValid>;
              • Returns the offset's value as a string

                Parameter ts

                Epoch milliseconds for which to get the offset

                Parameter format

                What style of offset to return. Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively

              method offset

              offset: (ts: number) => IfValid<number, typeof NaN, IsValid>;
              • Return the offset in minutes for this zone at the specified timestamp.

                Parameter ts

                Epoch milliseconds for which to compute the offset

              method offsetName

              offsetName: (
              ts: number,
              options: ZoneOffsetOptions
              ) => IfValid<string, null, IsValid>;
              • Returns the offset's common name (such as EST) at the specified timestamp

                Parameter ts

                Epoch milliseconds for which to get the name

                Parameter options

                Options to affect the format

                Parameter

                options.format - What style of offset to return.

                Parameter

                options.locale - What locale to return the offset name in.

              Interfaces

              interface DateObjectUnits

              interface DateObjectUnits {}
              • Note that ISO weekday and local weekday fields are mutually exclusive

              property day

              day?: number | undefined;

                property hour

                hour?: number | undefined;

                  property localWeekday

                  localWeekday?: WeekdayNumbers | undefined;

                    property localWeekNumber

                    localWeekNumber?: number | undefined;

                      property localWeekYear

                      localWeekYear?: number | undefined;

                        property millisecond

                        millisecond?: number | undefined;

                          property minute

                          minute?: number | undefined;

                            property month

                            month?: number | undefined;

                              property ordinal

                              ordinal?: number | undefined;

                                property second

                                second?: number | undefined;

                                  property weekday

                                  weekday?: WeekdayNumbers | undefined;

                                    property weekNumber

                                    weekNumber?: number | undefined;

                                      property weekYear

                                      weekYear?: number | undefined;

                                        property year

                                        year?: number | undefined;

                                          interface DateTimeOptions

                                          interface DateTimeOptions extends LocaleOptions {}

                                            property setZone

                                            setZone?: boolean | undefined;
                                            • Override the zone with a fixed-offset zone specified in the string itself, if it specifies one. false

                                            property zone

                                            zone?: string | Zone | undefined;
                                            • Use this zone if no offset is specified in the input string itself. Will also convert the time to this zone. local

                                            interface DiffOptions

                                            interface DiffOptions {}

                                              property conversionAccuracy

                                              conversionAccuracy?: ConversionAccuracy | undefined;
                                              • 'casual'

                                              interface DurationLikeObject

                                              interface DurationLikeObject extends DurationObjectUnits {}

                                                property day

                                                day?: number | undefined;

                                                  property hour

                                                  hour?: number | undefined;

                                                    property millisecond

                                                    millisecond?: number | undefined;

                                                      property minute

                                                      minute?: number | undefined;

                                                        property month

                                                        month?: number | undefined;

                                                          property quarter

                                                          quarter?: number | undefined;

                                                            property second

                                                            second?: number | undefined;

                                                              property week

                                                              week?: number | undefined;

                                                                property year

                                                                year?: number | undefined;

                                                                  interface DurationObjectUnits

                                                                  interface DurationObjectUnits {}

                                                                    property days

                                                                    days?: number | undefined;

                                                                      property hours

                                                                      hours?: number | undefined;

                                                                        property milliseconds

                                                                        milliseconds?: number | undefined;

                                                                          property minutes

                                                                          minutes?: number | undefined;

                                                                            property months

                                                                            months?: number | undefined;

                                                                              property quarters

                                                                              quarters?: number | undefined;

                                                                                property seconds

                                                                                seconds?: number | undefined;

                                                                                  property weeks

                                                                                  weeks?: number | undefined;

                                                                                    property years

                                                                                    years?: number | undefined;

                                                                                      interface DurationOptions

                                                                                      interface DurationOptions {}

                                                                                        property conversionAccuracy

                                                                                        conversionAccuracy?: ConversionAccuracy | undefined;

                                                                                          property locale

                                                                                          locale?: string | undefined;

                                                                                            property numberingSystem

                                                                                            numberingSystem?: NumberingSystem | undefined;

                                                                                              interface ExplainedFormat

                                                                                              interface ExplainedFormat {}

                                                                                                property input

                                                                                                input: string;

                                                                                                  property invalidReason

                                                                                                  invalidReason?: string | undefined;

                                                                                                    property matches

                                                                                                    matches?: { [k: string]: any } | undefined;

                                                                                                      property rawMatches

                                                                                                      rawMatches?: RegExpMatchArray | null | undefined;

                                                                                                        property regex

                                                                                                        regex?: RegExp | undefined;

                                                                                                          property result

                                                                                                          result?: { [k: string]: any } | null | undefined;

                                                                                                            property tokens

                                                                                                            tokens: Array<{ literal: boolean; val: string }>;

                                                                                                              property zone

                                                                                                              zone?: Zone | null | undefined;

                                                                                                                interface Features

                                                                                                                interface Features {}
                                                                                                                • The set of available features in this environment. Some features of Luxon are not available in all environments.

                                                                                                                property localeWeek

                                                                                                                localeWeek: boolean;
                                                                                                                • Whether this environment supports different weekdays for the start of the week based on the locale

                                                                                                                property relative

                                                                                                                relative: boolean;
                                                                                                                • Whether this environment supports relative time formatting

                                                                                                                interface InfoCalendarOptions

                                                                                                                interface InfoCalendarOptions extends InfoUnitOptions {}

                                                                                                                  property outputCalendar

                                                                                                                  outputCalendar?: CalendarSystem | undefined;
                                                                                                                  • gregory

                                                                                                                  interface InfoOptions

                                                                                                                  interface InfoOptions {}

                                                                                                                    property locale

                                                                                                                    locale?: string | undefined;

                                                                                                                      interface InfoUnitOptions

                                                                                                                      interface InfoUnitOptions extends InfoOptions {}

                                                                                                                        property numberingSystem

                                                                                                                        numberingSystem?: NumberingSystem | undefined;

                                                                                                                          interface IntervalObject

                                                                                                                          interface IntervalObject {}

                                                                                                                            property end

                                                                                                                            end?: DateTime | undefined;

                                                                                                                              property start

                                                                                                                              start?: DateTime | undefined;

                                                                                                                                interface LocaleOptions

                                                                                                                                interface LocaleOptions {}

                                                                                                                                  property locale

                                                                                                                                  locale?: string | undefined;
                                                                                                                                  • system's locale

                                                                                                                                  property numberingSystem

                                                                                                                                  numberingSystem?: NumberingSystem | undefined;

                                                                                                                                    property outputCalendar

                                                                                                                                    outputCalendar?: CalendarSystem | undefined;

                                                                                                                                      interface ToHumanDurationOptions

                                                                                                                                      interface ToHumanDurationOptions extends Intl.NumberFormatOptions {}

                                                                                                                                        property listStyle

                                                                                                                                        listStyle?: 'long' | 'short' | 'narrow' | undefined;

                                                                                                                                          interface ToISODateOptions

                                                                                                                                          interface ToISODateOptions {}

                                                                                                                                            property format

                                                                                                                                            format?: ToISOFormat | undefined;
                                                                                                                                            • Choose between the basic and extended format 'extended'

                                                                                                                                            interface ToISOTimeDurationOptions

                                                                                                                                            interface ToISOTimeDurationOptions {}

                                                                                                                                              property format

                                                                                                                                              format?: ToISOFormat | undefined;
                                                                                                                                              • Choose between the basic and extended format 'extended'

                                                                                                                                              property includePrefix

                                                                                                                                              includePrefix?: boolean | undefined;
                                                                                                                                              • Include the T prefix false

                                                                                                                                              property suppressMilliseconds

                                                                                                                                              suppressMilliseconds?: boolean | undefined;
                                                                                                                                              • Exclude milliseconds from the format if they are 0 false

                                                                                                                                              property suppressSeconds

                                                                                                                                              suppressSeconds?: boolean | undefined;
                                                                                                                                              • Exclude seconds from the format if they are 0 false

                                                                                                                                              interface ToISOTimeOptions

                                                                                                                                              interface ToISOTimeOptions extends ToISOTimeDurationOptions {}

                                                                                                                                                property extendedZone

                                                                                                                                                extendedZone?: boolean | undefined;
                                                                                                                                                • add the time zone format extension false

                                                                                                                                                property includeOffset

                                                                                                                                                includeOffset?: boolean | undefined;
                                                                                                                                                • Include the offset, such as 'Z' or '-04:00' true

                                                                                                                                                interface ToRelativeCalendarOptions

                                                                                                                                                interface ToRelativeCalendarOptions {}

                                                                                                                                                  property base

                                                                                                                                                  base?: DateTime | undefined;
                                                                                                                                                  • The DateTime to use as the basis to which this time is compared now

                                                                                                                                                  property locale

                                                                                                                                                  locale?: string | undefined;
                                                                                                                                                  • Override the locale of this DateTime

                                                                                                                                                  property numberingSystem

                                                                                                                                                  numberingSystem?: NumberingSystem | undefined;
                                                                                                                                                  • Override the numberingSystem of this DateTime. The Intl system may choose not to honor this.

                                                                                                                                                  property unit

                                                                                                                                                  unit?: ToRelativeUnit | undefined;
                                                                                                                                                  • If omitted, the method will pick the unit.

                                                                                                                                                  interface ToRelativeOptions

                                                                                                                                                  interface ToRelativeOptions extends Omit<ToRelativeCalendarOptions, 'unit'> {}

                                                                                                                                                    property padding

                                                                                                                                                    padding?: number | undefined;
                                                                                                                                                    • Padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Do not use this in combination with {round: false} because the decimal output will include the padding. 0

                                                                                                                                                    property round

                                                                                                                                                    round?: boolean | undefined;
                                                                                                                                                    • true

                                                                                                                                                    property style

                                                                                                                                                    style?: StringUnitLength | undefined;
                                                                                                                                                    • long

                                                                                                                                                    property unit

                                                                                                                                                    unit?: ToRelativeUnit | ToRelativeUnit[] | undefined;
                                                                                                                                                    • A single unit or an array of units. If an array is supplied, the method will pick the best one to use from the array. If omitted, the method will pick the unit from a default set.

                                                                                                                                                    interface ToSQLOptions

                                                                                                                                                    interface ToSQLOptions {}

                                                                                                                                                      property includeOffset

                                                                                                                                                      includeOffset?: boolean | undefined;
                                                                                                                                                      • Include the offset, such as 'Z' or '-04:00' true

                                                                                                                                                      property includeOffsetSpace

                                                                                                                                                      includeOffsetSpace?: boolean;
                                                                                                                                                      • include the space between the time and the offset, such as '05:15:16.345 -04:00' true

                                                                                                                                                      property includeZone

                                                                                                                                                      includeZone?: boolean | undefined;
                                                                                                                                                      • Include the zone, such as 'America/New_York'. Overrides includeOffset. false

                                                                                                                                                      interface TSSettings

                                                                                                                                                      interface TSSettings {}
                                                                                                                                                      • TS only settings. Consumers can declaration merge this interface to change TS options.

                                                                                                                                                        See Also

                                                                                                                                                        • Settings.throwOnInvalid

                                                                                                                                                      interface WeekSettings

                                                                                                                                                      interface WeekSettings {}

                                                                                                                                                        property firstDay

                                                                                                                                                        firstDay: WeekdayNumbers;

                                                                                                                                                          property minimalDays

                                                                                                                                                          minimalDays: WeekdayNumbers;

                                                                                                                                                            property weekend

                                                                                                                                                            weekend: WeekdayNumbers[];

                                                                                                                                                              interface ZoneOffsetOptions

                                                                                                                                                              interface ZoneOffsetOptions {}

                                                                                                                                                                property format

                                                                                                                                                                format?: 'short' | 'long' | undefined;
                                                                                                                                                                • What style of offset to return.

                                                                                                                                                                property locale

                                                                                                                                                                locale?: string | undefined;
                                                                                                                                                                • What locale to return the offset name in.

                                                                                                                                                                interface ZoneOptions

                                                                                                                                                                interface ZoneOptions {}

                                                                                                                                                                  property keepCalendarTime

                                                                                                                                                                  keepCalendarTime?: boolean | undefined;
                                                                                                                                                                  • Deprecated

                                                                                                                                                                    since 0.2.12. Use keepLocalTime instead

                                                                                                                                                                  property keepLocalTime

                                                                                                                                                                  keepLocalTime?: boolean | undefined;
                                                                                                                                                                  • If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this. Defaults to false.

                                                                                                                                                                  Type Aliases

                                                                                                                                                                  type CalendarSystem

                                                                                                                                                                  type CalendarSystem = Intl.DateTimeFormatOptions extends { calendar?: infer T }
                                                                                                                                                                  ? T
                                                                                                                                                                  :
                                                                                                                                                                  | 'buddhist'
                                                                                                                                                                  | 'chinese'
                                                                                                                                                                  | 'coptic'
                                                                                                                                                                  | 'ethioaa'
                                                                                                                                                                  | 'ethiopic'
                                                                                                                                                                  | 'gregory'
                                                                                                                                                                  | 'hebrew'
                                                                                                                                                                  | 'indian'
                                                                                                                                                                  | 'islamic'
                                                                                                                                                                  | 'islamicc'
                                                                                                                                                                  | 'iso8601'
                                                                                                                                                                  | 'japanese'
                                                                                                                                                                  | 'persian'
                                                                                                                                                                  | 'roc';

                                                                                                                                                                    type ConversionAccuracy

                                                                                                                                                                    type ConversionAccuracy = 'casual' | 'longterm';

                                                                                                                                                                      type CountOptions

                                                                                                                                                                      type CountOptions = _UseLocaleWeekOption;

                                                                                                                                                                        type DateInput

                                                                                                                                                                        type DateInput = DateTime | DateObjectUnits | Date;

                                                                                                                                                                          type DateTimeFormatOptions

                                                                                                                                                                          type DateTimeFormatOptions = Intl.DateTimeFormatOptions;

                                                                                                                                                                            type DateTimeFormatPreset

                                                                                                                                                                            type DateTimeFormatPreset = Intl.DateTimeFormatOptions;
                                                                                                                                                                            • Deprecated

                                                                                                                                                                              Use Intl.DateTimeFormatOptions instead.

                                                                                                                                                                            type DateTimeFormatPresetValue

                                                                                                                                                                            type DateTimeFormatPresetValue = 'numeric' | 'short' | 'long';
                                                                                                                                                                            • Deprecated

                                                                                                                                                                              You should use Intl.DateTimeFormatOptions fields and values instead.

                                                                                                                                                                            type DateTimeJSOptions

                                                                                                                                                                            type DateTimeJSOptions = Omit<DateTimeOptions, 'setZone'>;

                                                                                                                                                                              type DateTimeMaybeValid

                                                                                                                                                                              type DateTimeMaybeValid = CanBeInvalid extends true
                                                                                                                                                                              ? DateTime<Valid> | DateTime<Invalid>
                                                                                                                                                                              : DateTime;

                                                                                                                                                                                type DateTimeUnit

                                                                                                                                                                                type DateTimeUnit =
                                                                                                                                                                                | 'year'
                                                                                                                                                                                | 'quarter'
                                                                                                                                                                                | 'month'
                                                                                                                                                                                | 'week'
                                                                                                                                                                                | 'day'
                                                                                                                                                                                | 'hour'
                                                                                                                                                                                | 'minute'
                                                                                                                                                                                | 'second'
                                                                                                                                                                                | 'millisecond';

                                                                                                                                                                                  type DayNumbers

                                                                                                                                                                                  type DayNumbers =
                                                                                                                                                                                  | 1
                                                                                                                                                                                  | 2
                                                                                                                                                                                  | 3
                                                                                                                                                                                  | 4
                                                                                                                                                                                  | 5
                                                                                                                                                                                  | 6
                                                                                                                                                                                  | 7
                                                                                                                                                                                  | 8
                                                                                                                                                                                  | 9
                                                                                                                                                                                  | 10
                                                                                                                                                                                  | 11
                                                                                                                                                                                  | 12
                                                                                                                                                                                  | 13
                                                                                                                                                                                  | 14
                                                                                                                                                                                  | 15
                                                                                                                                                                                  | 16
                                                                                                                                                                                  | 17
                                                                                                                                                                                  | 18
                                                                                                                                                                                  | 19
                                                                                                                                                                                  | 20
                                                                                                                                                                                  | 21
                                                                                                                                                                                  | 22
                                                                                                                                                                                  | 23
                                                                                                                                                                                  | 24
                                                                                                                                                                                  | 25
                                                                                                                                                                                  | 26
                                                                                                                                                                                  | 27
                                                                                                                                                                                  | 28
                                                                                                                                                                                  | 29
                                                                                                                                                                                  | 30
                                                                                                                                                                                  | 31;

                                                                                                                                                                                    type DurationInput

                                                                                                                                                                                    type DurationInput = Duration | number | DurationLikeObject;
                                                                                                                                                                                    • Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()

                                                                                                                                                                                      Deprecated

                                                                                                                                                                                      Use DurationLike instead.

                                                                                                                                                                                    type DurationLike

                                                                                                                                                                                    type DurationLike = Duration | DurationLikeObject | number;
                                                                                                                                                                                    • Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()

                                                                                                                                                                                    type DurationMaybeValid

                                                                                                                                                                                    type DurationMaybeValid = CanBeInvalid extends true
                                                                                                                                                                                    ? Duration<Valid> | Duration<Invalid>
                                                                                                                                                                                    : Duration;

                                                                                                                                                                                      type DurationUnit

                                                                                                                                                                                      type DurationUnit = keyof DurationLikeObject;

                                                                                                                                                                                        type DurationUnits

                                                                                                                                                                                        type DurationUnits = DurationUnit | DurationUnit[];

                                                                                                                                                                                          type EndOfOptions

                                                                                                                                                                                          type EndOfOptions = _UseLocaleWeekOption;

                                                                                                                                                                                            type EraLength

                                                                                                                                                                                            type EraLength = StringUnitLength;
                                                                                                                                                                                            • Deprecated

                                                                                                                                                                                            type HasSameOptions

                                                                                                                                                                                            type HasSameOptions = _UseLocaleWeekOption;

                                                                                                                                                                                              type HourCycle

                                                                                                                                                                                              type HourCycle = 'h11' | 'h12' | 'h23' | 'h24';

                                                                                                                                                                                                type HourNumbers

                                                                                                                                                                                                type HourNumbers =
                                                                                                                                                                                                | 0
                                                                                                                                                                                                | 1
                                                                                                                                                                                                | 2
                                                                                                                                                                                                | 3
                                                                                                                                                                                                | 4
                                                                                                                                                                                                | 5
                                                                                                                                                                                                | 6
                                                                                                                                                                                                | 7
                                                                                                                                                                                                | 8
                                                                                                                                                                                                | 9
                                                                                                                                                                                                | 10
                                                                                                                                                                                                | 11
                                                                                                                                                                                                | 12
                                                                                                                                                                                                | 13
                                                                                                                                                                                                | 14
                                                                                                                                                                                                | 15
                                                                                                                                                                                                | 16
                                                                                                                                                                                                | 17
                                                                                                                                                                                                | 18
                                                                                                                                                                                                | 19
                                                                                                                                                                                                | 20
                                                                                                                                                                                                | 21
                                                                                                                                                                                                | 22
                                                                                                                                                                                                | 23;

                                                                                                                                                                                                  type IntervalMaybeValid

                                                                                                                                                                                                  type IntervalMaybeValid = CanBeInvalid extends true
                                                                                                                                                                                                  ? Interval<Valid> | Interval<Invalid>
                                                                                                                                                                                                  : Interval;

                                                                                                                                                                                                    type ISOTimeOptions

                                                                                                                                                                                                    type ISOTimeOptions = ToISOTimeOptions;
                                                                                                                                                                                                    • Deprecated

                                                                                                                                                                                                      alias for backwards compatibility

                                                                                                                                                                                                    type MinuteNumbers

                                                                                                                                                                                                    type MinuteNumbers = SecondNumbers;

                                                                                                                                                                                                      type MonthNumbers

                                                                                                                                                                                                      type MonthNumbers = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;

                                                                                                                                                                                                        type NumberingSystem

                                                                                                                                                                                                        type NumberingSystem = Intl.DateTimeFormatOptions extends {
                                                                                                                                                                                                        numberingSystem?: infer T;
                                                                                                                                                                                                        }
                                                                                                                                                                                                        ? T
                                                                                                                                                                                                        :
                                                                                                                                                                                                        | 'arab'
                                                                                                                                                                                                        | 'arabext'
                                                                                                                                                                                                        | 'bali'
                                                                                                                                                                                                        | 'beng'
                                                                                                                                                                                                        | 'deva'
                                                                                                                                                                                                        | 'fullwide'
                                                                                                                                                                                                        | 'gujr'
                                                                                                                                                                                                        | 'guru'
                                                                                                                                                                                                        | 'hanidec'
                                                                                                                                                                                                        | 'khmr'
                                                                                                                                                                                                        | 'knda'
                                                                                                                                                                                                        | 'laoo'
                                                                                                                                                                                                        | 'latn'
                                                                                                                                                                                                        | 'limb'
                                                                                                                                                                                                        | 'mlym'
                                                                                                                                                                                                        | 'mong'
                                                                                                                                                                                                        | 'mymr'
                                                                                                                                                                                                        | 'orya'
                                                                                                                                                                                                        | 'tamldec'
                                                                                                                                                                                                        | 'telu'
                                                                                                                                                                                                        | 'thai'
                                                                                                                                                                                                        | 'tibt';

                                                                                                                                                                                                          type NumberUnitLength

                                                                                                                                                                                                          type NumberUnitLength = 'numeric' | '2-digit';

                                                                                                                                                                                                            type PossibleDaysInMonth

                                                                                                                                                                                                            type PossibleDaysInMonth = 28 | 29 | 30 | 31;

                                                                                                                                                                                                              type PossibleDaysInYear

                                                                                                                                                                                                              type PossibleDaysInYear = 365 | 366;

                                                                                                                                                                                                                type PossibleWeeksInYear

                                                                                                                                                                                                                type PossibleWeeksInYear = 52 | 53;

                                                                                                                                                                                                                  type QuarterNumbers

                                                                                                                                                                                                                  type QuarterNumbers = 1 | 2 | 3 | 4;

                                                                                                                                                                                                                    type ResolvedLocaleOptions

                                                                                                                                                                                                                    type ResolvedLocaleOptions = Required<LocaleOptions>;

                                                                                                                                                                                                                      type SecondNumbers

                                                                                                                                                                                                                      type SecondNumbers =
                                                                                                                                                                                                                      | 0
                                                                                                                                                                                                                      | 1
                                                                                                                                                                                                                      | 2
                                                                                                                                                                                                                      | 3
                                                                                                                                                                                                                      | 4
                                                                                                                                                                                                                      | 5
                                                                                                                                                                                                                      | 6
                                                                                                                                                                                                                      | 7
                                                                                                                                                                                                                      | 8
                                                                                                                                                                                                                      | 9
                                                                                                                                                                                                                      | 10
                                                                                                                                                                                                                      | 11
                                                                                                                                                                                                                      | 12
                                                                                                                                                                                                                      | 13
                                                                                                                                                                                                                      | 14
                                                                                                                                                                                                                      | 15
                                                                                                                                                                                                                      | 16
                                                                                                                                                                                                                      | 17
                                                                                                                                                                                                                      | 18
                                                                                                                                                                                                                      | 19
                                                                                                                                                                                                                      | 20
                                                                                                                                                                                                                      | 21
                                                                                                                                                                                                                      | 22
                                                                                                                                                                                                                      | 23
                                                                                                                                                                                                                      | 24
                                                                                                                                                                                                                      | 25
                                                                                                                                                                                                                      | 26
                                                                                                                                                                                                                      | 27
                                                                                                                                                                                                                      | 28
                                                                                                                                                                                                                      | 29
                                                                                                                                                                                                                      | 30
                                                                                                                                                                                                                      | 31
                                                                                                                                                                                                                      | 32
                                                                                                                                                                                                                      | 33
                                                                                                                                                                                                                      | 34
                                                                                                                                                                                                                      | 35
                                                                                                                                                                                                                      | 36
                                                                                                                                                                                                                      | 37
                                                                                                                                                                                                                      | 38
                                                                                                                                                                                                                      | 39
                                                                                                                                                                                                                      | 40
                                                                                                                                                                                                                      | 41
                                                                                                                                                                                                                      | 42
                                                                                                                                                                                                                      | 43
                                                                                                                                                                                                                      | 44
                                                                                                                                                                                                                      | 45
                                                                                                                                                                                                                      | 46
                                                                                                                                                                                                                      | 47
                                                                                                                                                                                                                      | 48
                                                                                                                                                                                                                      | 49
                                                                                                                                                                                                                      | 50
                                                                                                                                                                                                                      | 51
                                                                                                                                                                                                                      | 52
                                                                                                                                                                                                                      | 53
                                                                                                                                                                                                                      | 54
                                                                                                                                                                                                                      | 55
                                                                                                                                                                                                                      | 56
                                                                                                                                                                                                                      | 57
                                                                                                                                                                                                                      | 58
                                                                                                                                                                                                                      | 59;

                                                                                                                                                                                                                        type StartOfOptions

                                                                                                                                                                                                                        type StartOfOptions = _UseLocaleWeekOption;

                                                                                                                                                                                                                          type StringUnitLength

                                                                                                                                                                                                                          type StringUnitLength = 'narrow' | 'short' | 'long';

                                                                                                                                                                                                                            type ToISOFormat

                                                                                                                                                                                                                            type ToISOFormat = 'basic' | 'extended';

                                                                                                                                                                                                                              type ToObjectOutput

                                                                                                                                                                                                                              type ToObjectOutput<
                                                                                                                                                                                                                              IncludeConfig extends boolean | undefined = undefined,
                                                                                                                                                                                                                              IsValid extends boolean | undefined = undefined
                                                                                                                                                                                                                              > = IsValid extends true
                                                                                                                                                                                                                              ? _ToObjectOutput<IncludeConfig>
                                                                                                                                                                                                                              : CanBeInvalid extends false
                                                                                                                                                                                                                              ? _ToObjectOutput<IncludeConfig>
                                                                                                                                                                                                                              : Partial<_ToObjectOutput<IncludeConfig>>;

                                                                                                                                                                                                                                type ToRelativeUnit

                                                                                                                                                                                                                                type ToRelativeUnit =
                                                                                                                                                                                                                                | 'years'
                                                                                                                                                                                                                                | 'quarters'
                                                                                                                                                                                                                                | 'months'
                                                                                                                                                                                                                                | 'weeks'
                                                                                                                                                                                                                                | 'days'
                                                                                                                                                                                                                                | 'hours'
                                                                                                                                                                                                                                | 'minutes'
                                                                                                                                                                                                                                | 'seconds';

                                                                                                                                                                                                                                  type UnitLength

                                                                                                                                                                                                                                  type UnitLength = StringUnitLength | NumberUnitLength;

                                                                                                                                                                                                                                    type UnitOptions

                                                                                                                                                                                                                                    type UnitOptions = InfoUnitOptions;
                                                                                                                                                                                                                                    • Deprecated

                                                                                                                                                                                                                                    type WeekdayNumbers

                                                                                                                                                                                                                                    type WeekdayNumbers = 1 | 2 | 3 | 4 | 5 | 6 | 7;

                                                                                                                                                                                                                                      type WeekNumbers

                                                                                                                                                                                                                                      type WeekNumbers =
                                                                                                                                                                                                                                      | 1
                                                                                                                                                                                                                                      | 2
                                                                                                                                                                                                                                      | 3
                                                                                                                                                                                                                                      | 4
                                                                                                                                                                                                                                      | 5
                                                                                                                                                                                                                                      | 6
                                                                                                                                                                                                                                      | 7
                                                                                                                                                                                                                                      | 8
                                                                                                                                                                                                                                      | 9
                                                                                                                                                                                                                                      | 10
                                                                                                                                                                                                                                      | 11
                                                                                                                                                                                                                                      | 12
                                                                                                                                                                                                                                      | 13
                                                                                                                                                                                                                                      | 14
                                                                                                                                                                                                                                      | 15
                                                                                                                                                                                                                                      | 16
                                                                                                                                                                                                                                      | 17
                                                                                                                                                                                                                                      | 18
                                                                                                                                                                                                                                      | 19
                                                                                                                                                                                                                                      | 20
                                                                                                                                                                                                                                      | 21
                                                                                                                                                                                                                                      | 22
                                                                                                                                                                                                                                      | 23
                                                                                                                                                                                                                                      | 24
                                                                                                                                                                                                                                      | 25
                                                                                                                                                                                                                                      | 26
                                                                                                                                                                                                                                      | 27
                                                                                                                                                                                                                                      | 28
                                                                                                                                                                                                                                      | 29
                                                                                                                                                                                                                                      | 30
                                                                                                                                                                                                                                      | 31
                                                                                                                                                                                                                                      | 32
                                                                                                                                                                                                                                      | 33
                                                                                                                                                                                                                                      | 34
                                                                                                                                                                                                                                      | 35
                                                                                                                                                                                                                                      | 36
                                                                                                                                                                                                                                      | 37
                                                                                                                                                                                                                                      | 38
                                                                                                                                                                                                                                      | 39
                                                                                                                                                                                                                                      | 40
                                                                                                                                                                                                                                      | 41
                                                                                                                                                                                                                                      | 42
                                                                                                                                                                                                                                      | 43
                                                                                                                                                                                                                                      | 44
                                                                                                                                                                                                                                      | 45
                                                                                                                                                                                                                                      | 46
                                                                                                                                                                                                                                      | 47
                                                                                                                                                                                                                                      | 48
                                                                                                                                                                                                                                      | 49
                                                                                                                                                                                                                                      | 50
                                                                                                                                                                                                                                      | 51
                                                                                                                                                                                                                                      | 52
                                                                                                                                                                                                                                      | 53;

                                                                                                                                                                                                                                        type ZoneMaybeValid

                                                                                                                                                                                                                                        type ZoneMaybeValid = CanBeInvalid extends true ? Zone<true> | Zone<false> : Zone;

                                                                                                                                                                                                                                          type ZoneOffsetFormat

                                                                                                                                                                                                                                          type ZoneOffsetFormat = 'narrow' | 'short' | 'techie';
                                                                                                                                                                                                                                          • What style of offset to return. Returning '+6', '+06:00', or '+0600' respectively

                                                                                                                                                                                                                                          Namespaces

                                                                                                                                                                                                                                          namespace Info

                                                                                                                                                                                                                                          namespace Info {}
                                                                                                                                                                                                                                          • The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.

                                                                                                                                                                                                                                          function eras

                                                                                                                                                                                                                                          eras: (length?: StringUnitLength, opts?: InfoOptions) => string[];
                                                                                                                                                                                                                                          • Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.

                                                                                                                                                                                                                                            Parameter length

                                                                                                                                                                                                                                            the length of the era representation. Defaults to 'short'.

                                                                                                                                                                                                                                            Parameter opts

                                                                                                                                                                                                                                            options

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.locale - the locale code

                                                                                                                                                                                                                                            Example 1

                                                                                                                                                                                                                                            Info.eras() //=> [ 'BC', 'AD' ]

                                                                                                                                                                                                                                            Example 2

                                                                                                                                                                                                                                            Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]

                                                                                                                                                                                                                                            Example 3

                                                                                                                                                                                                                                            Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]

                                                                                                                                                                                                                                          function features

                                                                                                                                                                                                                                          features: () => Features;
                                                                                                                                                                                                                                          • Return the set of available features in this environment. Some features of Luxon are not available in all environments. For example, on older browsers, timezone support is not available. Use this function to figure out if that is the case.

                                                                                                                                                                                                                                            Example 1

                                                                                                                                                                                                                                            Info.features() //=> { intl: true, intlTokens: false, zones: true, relative: false }

                                                                                                                                                                                                                                          function getMinimumDaysInFirstWeek

                                                                                                                                                                                                                                          getMinimumDaysInFirstWeek: (input?: LocaleInput) => WeekdayNumbers;
                                                                                                                                                                                                                                          • Get the minimum number of days necessary in a week before it is considered part of the next year, according to the given locale.

                                                                                                                                                                                                                                          function getStartOfWeek

                                                                                                                                                                                                                                          getStartOfWeek: (input?: LocaleInput) => WeekdayNumbers;
                                                                                                                                                                                                                                          • Get the weekday on which the week starts, according to the given locale.

                                                                                                                                                                                                                                          function getWeekendWeekdays

                                                                                                                                                                                                                                          getWeekendWeekdays: (input?: LocaleInput) => WeekdayNumbers[];
                                                                                                                                                                                                                                          • Get the weekdays which are considered the weekend, according to the given locale.

                                                                                                                                                                                                                                          function hasDST

                                                                                                                                                                                                                                          hasDST: (zone?: string | Zone) => boolean;
                                                                                                                                                                                                                                          • Return whether the specified zone contains a DST.

                                                                                                                                                                                                                                            Parameter zone

                                                                                                                                                                                                                                            Zone to check. Defaults to the environment's local zone. Defaults to 'local'.

                                                                                                                                                                                                                                          function isValidIANAZone

                                                                                                                                                                                                                                          isValidIANAZone: (zone: string) => boolean;
                                                                                                                                                                                                                                          • Return whether the specified zone is a valid IANA specifier.

                                                                                                                                                                                                                                            Parameter zone

                                                                                                                                                                                                                                            Zone to check

                                                                                                                                                                                                                                          function meridiems

                                                                                                                                                                                                                                          meridiems: (opts?: InfoOptions) => string[];
                                                                                                                                                                                                                                          • Return an array of meridiems.

                                                                                                                                                                                                                                            Parameter opts

                                                                                                                                                                                                                                            options

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.locale - the locale code

                                                                                                                                                                                                                                            Example 1

                                                                                                                                                                                                                                            Info.meridiems() //=> [ 'AM', 'PM' ]

                                                                                                                                                                                                                                            Example 2

                                                                                                                                                                                                                                            Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]

                                                                                                                                                                                                                                          function months

                                                                                                                                                                                                                                          months: (length?: UnitLength, opts?: InfoCalendarOptions) => string[];
                                                                                                                                                                                                                                          • Return an array of standalone month names.

                                                                                                                                                                                                                                            Parameter length

                                                                                                                                                                                                                                            the length of the month representation. Defaults to 'long'.

                                                                                                                                                                                                                                            Parameter opts

                                                                                                                                                                                                                                            options

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.locale - the locale code

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.numberingSystem - the numbering system.

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.locObj - an existing locale object to use.

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.outputCalendar - the calendar. Defaults to 'gregory'.

                                                                                                                                                                                                                                            Example 1

                                                                                                                                                                                                                                            Info.months()[0] //=> 'January'

                                                                                                                                                                                                                                            Example 2

                                                                                                                                                                                                                                            Info.months('short')[0] //=> 'Jan'

                                                                                                                                                                                                                                            Example 3

                                                                                                                                                                                                                                            Info.months('numeric')[0] //=> '1'

                                                                                                                                                                                                                                            Example 4

                                                                                                                                                                                                                                            Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'

                                                                                                                                                                                                                                            Example 5

                                                                                                                                                                                                                                            Info.months('numeric', { locale: 'ar' })[0] //=> '١'

                                                                                                                                                                                                                                            Example 6

                                                                                                                                                                                                                                            Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'

                                                                                                                                                                                                                                            See Also

                                                                                                                                                                                                                                            • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat

                                                                                                                                                                                                                                          function monthsFormat

                                                                                                                                                                                                                                          monthsFormat: (length?: UnitLength, opts?: InfoCalendarOptions) => string[];
                                                                                                                                                                                                                                          • Return an array of format month names. Format months differ from standalone months in that they are meant to appear next to the day of the month. In some languages, that changes the string. See Info#months

                                                                                                                                                                                                                                            Parameter length

                                                                                                                                                                                                                                            the length of the month representation. Defaults to 'long'.

                                                                                                                                                                                                                                            Parameter opts

                                                                                                                                                                                                                                            options

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.locale - the locale code

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.numberingSystem - the numbering system.

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.locObj - an existing locale object to use.

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.outputCalendar - the calendar. Defaults to 'gregory'.

                                                                                                                                                                                                                                          function normalizeZone

                                                                                                                                                                                                                                          normalizeZone: (input?: string | Zone | number) => Zone;
                                                                                                                                                                                                                                          • Converts the input into a Zone instance.

                                                                                                                                                                                                                                            * If input is already a Zone instance, it is returned unchanged. * If input is a string containing a valid time zone name, a Zone instance with that name is returned. * If input is a string that doesn't refer to a known time zone, a Zone instance with Zone.isValid == false is returned. * If `input is a number, a Zone instance with the specified fixed offset in minutes is returned. * If input is null or undefined, the default zone is returned.

                                                                                                                                                                                                                                            Parameter input

                                                                                                                                                                                                                                            the value to be converted

                                                                                                                                                                                                                                          function weekdays

                                                                                                                                                                                                                                          weekdays: (length?: StringUnitLength, opts?: InfoUnitOptions) => string[];
                                                                                                                                                                                                                                          • Return an array of standalone week names.

                                                                                                                                                                                                                                            Parameter length

                                                                                                                                                                                                                                            the length of the weekday representation. Defaults to 'long'.

                                                                                                                                                                                                                                            Parameter opts

                                                                                                                                                                                                                                            options

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.locale - the locale code

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.numberingSystem - the numbering system.

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.locObj - an existing locale object to use.

                                                                                                                                                                                                                                            Example 1

                                                                                                                                                                                                                                            Info.weekdays()[0] //=> 'Monday'

                                                                                                                                                                                                                                            Example 2

                                                                                                                                                                                                                                            Info.weekdays('short')[0] //=> 'Mon'

                                                                                                                                                                                                                                            Example 3

                                                                                                                                                                                                                                            Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'

                                                                                                                                                                                                                                            Example 4

                                                                                                                                                                                                                                            Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'

                                                                                                                                                                                                                                            See Also

                                                                                                                                                                                                                                            • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat

                                                                                                                                                                                                                                          function weekdaysFormat

                                                                                                                                                                                                                                          weekdaysFormat: (length?: StringUnitLength, opts?: InfoUnitOptions) => string[];
                                                                                                                                                                                                                                          • Return an array of format week names. Format weekdays differ from standalone weekdays in that they are meant to appear next to more date information. In some languages, that changes the string. See Info#weekdays

                                                                                                                                                                                                                                            Parameter length

                                                                                                                                                                                                                                            the length of the month representation. Defaults to 'long'.

                                                                                                                                                                                                                                            Parameter opts

                                                                                                                                                                                                                                            options

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.locale - the locale code.

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.numberingSystem - the numbering system.

                                                                                                                                                                                                                                            Parameter

                                                                                                                                                                                                                                            opts.locObj - an existing locale object to use.

                                                                                                                                                                                                                                          interface LocaleInput

                                                                                                                                                                                                                                          interface LocaleInput {}

                                                                                                                                                                                                                                            property locale

                                                                                                                                                                                                                                            locale?: string | null | undefined;
                                                                                                                                                                                                                                            • the locale code

                                                                                                                                                                                                                                            property locObj

                                                                                                                                                                                                                                            locObj?: object | null | undefined;
                                                                                                                                                                                                                                            • an existing locale object to use, instead of the locale code string

                                                                                                                                                                                                                                            Package Files (9)

                                                                                                                                                                                                                                            Dependencies (0)

                                                                                                                                                                                                                                            No dependencies.

                                                                                                                                                                                                                                            Dev Dependencies (0)

                                                                                                                                                                                                                                            No dev dependencies.

                                                                                                                                                                                                                                            Peer Dependencies (0)

                                                                                                                                                                                                                                            No peer dependencies.

                                                                                                                                                                                                                                            Badge

                                                                                                                                                                                                                                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/luxon.

                                                                                                                                                                                                                                            • Markdown
                                                                                                                                                                                                                                              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/luxon)
                                                                                                                                                                                                                                            • HTML
                                                                                                                                                                                                                                              <a href="https://www.jsdocs.io/package/@types/luxon"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>