# Luxon dates

> Dates and times with Luxon: `$now` and `$today` are Luxon DateTime values, so every method below works on them.

Source: https://docs.sommatic.ai/en/expressions/luxon/

Version: 3.7.2 (MIT). Official documentation: https://moment.github.io/luxon/api-docs/index.html

`$now` uses the server time zone: set the zone you need before formatting.

```
{{ $now.setZone('America/Bogota').toFormat('yyyy-LL-dd HH:mm') }}
```

## Create a DateTime

### `DateTime.buildFormatParser(fmt, options = {})`

Build a parser for `fmt` using the given locale. This parser can be passed
to `DateTime.fromFormatParser` to a parse a date in this format. This
can be used to optimize cases where many dates need to be parsed in a
specific format.

- `fmt` (String): the format the string is expected to be in (see
description)
- `options` (Object): options used to set locale and numberingSystem
for parser

Returns `TokenParser`.

### `DateTime.DATE_FULL`

`DateTime#toLocaleString` format like 'October 14, 1983'

### `DateTime.DATE_HUGE`

`DateTime#toLocaleString` format like 'Tuesday, October 14, 1983'

### `DateTime.DATE_MED`

`DateTime#toLocaleString` format like 'Oct 14, 1983'

### `DateTime.DATE_MED_WITH_WEEKDAY`

`DateTime#toLocaleString` format like 'Fri, Oct 14, 1983'

### `DateTime.DATE_SHORT`

`DateTime#toLocaleString` format like 10/14/1983

### `DateTime.DATETIME_FULL`

`DateTime#toLocaleString` format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.

### `DateTime.DATETIME_FULL_WITH_SECONDS`

`DateTime#toLocaleString` format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.

### `DateTime.DATETIME_HUGE`

`DateTime#toLocaleString` format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.

### `DateTime.DATETIME_HUGE_WITH_SECONDS`

`DateTime#toLocaleString` format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.

### `DateTime.DATETIME_MED`

`DateTime#toLocaleString` format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.

### `DateTime.DATETIME_MED_WITH_SECONDS`

`DateTime#toLocaleString` format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.

### `DateTime.DATETIME_MED_WITH_WEEKDAY`

`DateTime#toLocaleString` format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.

### `DateTime.DATETIME_SHORT`

`DateTime#toLocaleString` format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.

### `DateTime.DATETIME_SHORT_WITH_SECONDS`

`DateTime#toLocaleString` format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.

### `DateTime.expandFormat(fmt, localeOpts = {})`

Produce the the fully expanded format token for the locale
Does NOT quote characters, so quoted tokens will not round trip correctly

- `fmt`
- `localeOpts`

Returns `string`.

### `DateTime.fromFormat(text, fmt, opts = {})`

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).

- `text` (string): the string to parse
- `fmt` (string): the format the string is expected to be in (see the link below for the formats)
- `opts` (Object): options to affect the creation
- `opts.zone` (string|Zone, optional, default 'local'): use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone
- `opts.setZone` (boolean, optional, default false): override the zone with a zone specified in the string itself, if it specifies one
- `opts.locale` (string, optional, default 'en-US'): a locale string to use when parsing. Will also set the DateTime to this locale
- `opts.numberingSystem` (string): the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system
- `opts.weekSettings` (string): the week settings to set on the resulting DateTime instance
- `opts.outputCalendar` (string): the output calendar to set on the resulting DateTime instance

Returns `DateTime`.

### `DateTime.fromFormatExplain(text, fmt, options = {})`

Explain how a string would be parsed by fromFormat()

- `text` (string): the string to parse
- `fmt` (string): the format the string is expected to be in (see description)
- `options` (Object): options taken by fromFormat()

Returns `Object`.

### `DateTime.fromFormatParser(text, formatParser, opts = {})`

Create a DateTime from an input string and format parser.

The format parser must have been created with the same locale as this call.

- `text` (String): the string to parse
- `formatParser` (TokenParser): parser from `DateTime.buildFormatParser`
- `opts` (Object): options taken by fromFormat()

Returns `DateTime`.

### `DateTime.fromHTTP(text, opts = {})`

Create a DateTime from an HTTP header date

- `text` (string): the HTTP header date
- `opts` (Object): options to affect the creation
- `opts.zone` (string|Zone, optional, default 'local'): 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.
- `opts.setZone` (boolean, optional, default false): 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.
- `opts.locale` (string, optional, default 'system's locale'): a locale to set on the resulting DateTime instance
- `opts.outputCalendar` (string): the output calendar to set on the resulting DateTime instance
- `opts.numberingSystem` (string): the numbering system to set on the resulting DateTime instance
- `opts.weekSettings` (string): the week settings to set on the resulting DateTime instance

Returns `DateTime`.

```javascript
{{ $now.constructor.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT') }}
```

Result (DateTime):

```json
"1994-11-06T08:49:37.000Z"
```

```javascript
{{ $now.constructor.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT') }}
```

Result (DateTime):

```json
"1994-11-06T08:49:37.000Z"
```

```javascript
{{ $now.constructor.fromHTTP('Sun Nov  6 08:49:37 1994') }}
```

Result (DateTime):

```json
"1994-11-06T08:49:37.000Z"
```

### `DateTime.fromISO(text, opts = {})`

Create a DateTime from an ISO 8601 string

- `text` (string): the ISO string
- `opts` (Object): options to affect the creation
- `opts.zone` (string|Zone, optional, default 'local'): use this zone if no offset is specified in the input string itself. Will also convert the time to this zone
- `opts.setZone` (boolean, optional, default false): override the zone with a fixed-offset zone specified in the string itself, if it specifies one
- `opts.locale` (string, optional, default 'system's locale'): a locale to set on the resulting DateTime instance
- `opts.outputCalendar` (string, optional): the output calendar to set on the resulting DateTime instance
- `opts.numberingSystem` (string, optional): the numbering system to set on the resulting DateTime instance
- `opts.weekSettings` (string, optional): the week settings to set on the resulting DateTime instance

Returns `DateTime`.

```javascript
{{ $now.constructor.fromISO('2016-05-25T09:08:34.123') }}
```

Result (DateTime):

```json
"2016-05-25T09:08:34.123Z"
```

```javascript
{{ $now.constructor.fromISO('2016-05-25T09:08:34.123+06:00') }}
```

Result (DateTime):

```json
"2016-05-25T03:08:34.123Z"
```

```javascript
{{ $now.constructor.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true}) }}
```

Result (DateTime):

```json
"2016-05-25T09:08:34.123+06:00"
```

### `DateTime.fromJSDate(date, options = {})`

Create a DateTime from a JavaScript Date object. Uses the default zone.

- `date` (Date): a JavaScript Date object
- `options` (Object): configuration options for the DateTime
- `options.zone` (string|Zone, optional, default 'local'): the zone to place the DateTime into

Returns `DateTime`.

### `DateTime.fromMillis(milliseconds, options = {})`

Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.

- `milliseconds` (number): a number of milliseconds since 1970 UTC
- `options` (Object): configuration options for the DateTime
- `options.zone` (string|Zone, optional, default 'local'): the zone to place the DateTime into
- `options.locale` (string, optional): a locale to set on the resulting DateTime instance
- `options.outputCalendar` (string): the output calendar to set on the resulting DateTime instance
- `options.numberingSystem` (string): the numbering system to set on the resulting DateTime instance
- `options.weekSettings` (string): the week settings to set on the resulting DateTime instance

Returns `DateTime`.

### `DateTime.fromObject(obj, opts = {})`

Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.

- `obj` (Object): the object to create the DateTime from
- `obj.year` (number): a year, such as 1987
- `obj.month` (number): a month, 1-12
- `obj.day` (number): a day of the month, 1-31, depending on the month
- `obj.ordinal` (number): day of the year, 1-365 or 366
- `obj.weekYear` (number): an ISO week year
- `obj.weekNumber` (number): an ISO week number, between 1 and 52 or 53, depending on the year
- `obj.weekday` (number): an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday
- `obj.localWeekYear` (number): a week year, according to the locale
- `obj.localWeekNumber` (number): a week number, between 1 and 52 or 53, depending on the year, according to the locale
- `obj.localWeekday` (number): a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale
- `obj.hour` (number): hour of the day, 0-23
- `obj.minute` (number): minute of the hour, 0-59
- `obj.second` (number): second of the minute, 0-59
- `obj.millisecond` (number): millisecond of the second, 0-999
- `opts` (Object): options for creating this DateTime
- `opts.zone` (string|Zone, optional, default 'local'): interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()
- `opts.locale` (string, optional, default 'system\'s locale'): a locale to set on the resulting DateTime instance
- `opts.outputCalendar` (string): the output calendar to set on the resulting DateTime instance
- `opts.numberingSystem` (string): the numbering system to set on the resulting DateTime instance
- `opts.weekSettings` (string): the week settings to set on the resulting DateTime instance

Returns `DateTime`.

```javascript
{{ $now.constructor.fromObject({ year: 1982, month: 5, day: 25}).toISODate() }}
```

Result (string):

```json
"1982-05-25"
```

```javascript
{{ $now.constructor.fromObject({ year: 1982 }).toISODate() }}
```

Result (string):

```json
"1982-01-01"
```

```javascript
{{ $now.constructor.fromObject({ hour: 10, minute: 26, second: 6 }) }}
```

Result (DateTime):

```json
"2026-11-26T10:26:06.000Z"
```

### `DateTime.fromRFC2822(text, opts = {})`

Create a DateTime from an RFC 2822 string

- `text` (string): the RFC 2822 string
- `opts` (Object): options to affect the creation
- `opts.zone` (string|Zone, optional, default 'local'): 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.
- `opts.setZone` (boolean, optional, default false): override the zone with a fixed-offset zone specified in the string itself, if it specifies one
- `opts.locale` (string, optional, default 'system's locale'): a locale to set on the resulting DateTime instance
- `opts.outputCalendar` (string): the output calendar to set on the resulting DateTime instance
- `opts.numberingSystem` (string): the numbering system to set on the resulting DateTime instance
- `opts.weekSettings` (string): the week settings to set on the resulting DateTime instance

Returns `DateTime`.

```javascript
{{ $now.constructor.fromRFC2822('25 Nov 2016 13:23:12 GMT') }}
```

Result (DateTime):

```json
"2016-11-25T13:23:12.000Z"
```

```javascript
{{ $now.constructor.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600') }}
```

Result (DateTime):

```json
"2016-11-25T07:23:12.000Z"
```

```javascript
{{ $now.constructor.fromRFC2822('25 Nov 2016 13:23 Z') }}
```

Result (DateTime):

```json
"2016-11-25T13:23:00.000Z"
```

### `DateTime.fromSeconds(seconds, options = {})`

Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.

- `seconds` (number): a number of seconds since 1970 UTC
- `options` (Object): configuration options for the DateTime
- `options.zone` (string|Zone, optional, default 'local'): the zone to place the DateTime into
- `options.locale` (string, optional): a locale to set on the resulting DateTime instance
- `options.outputCalendar` (string): the output calendar to set on the resulting DateTime instance
- `options.numberingSystem` (string): the numbering system to set on the resulting DateTime instance
- `options.weekSettings` (string): the week settings to set on the resulting DateTime instance

Returns `DateTime`.

### `DateTime.fromSQL(text, opts = {})`

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

- `text` (string): the string to parse
- `opts` (Object): options to affect the creation
- `opts.zone` (string|Zone, optional, default 'local'): use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone
- `opts.setZone` (boolean, optional, default false): override the zone with a zone specified in the string itself, if it specifies one
- `opts.locale` (string, optional, default 'en-US'): a locale string to use when parsing. Will also set the DateTime to this locale
- `opts.numberingSystem` (string): the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system
- `opts.weekSettings` (string): the week settings to set on the resulting DateTime instance
- `opts.outputCalendar` (string): the output calendar to set on the resulting DateTime instance

Returns `DateTime`.

```javascript
{{ $now.constructor.fromSQL('2017-05-15') }}
```

Result (DateTime):

```json
"2017-05-15T00:00:00.000Z"
```

```javascript
{{ $now.constructor.fromSQL('2017-05-15 09:12:34') }}
```

Result (DateTime):

```json
"2017-05-15T09:12:34.000Z"
```

```javascript
{{ $now.constructor.fromSQL('2017-05-15 09:12:34.342') }}
```

Result (DateTime):

```json
"2017-05-15T09:12:34.342Z"
```

### `DateTime.invalid(reason, explanation = null)`

Create an invalid DateTime.

- `reason` (string): simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.
- `explanation` (string, optional, default null): longer explanation, may include parameters and other useful debugging information

Returns `DateTime`.

### `DateTime.isDateTime(o)`

Check if an object is an instance of DateTime. Works across context boundaries

- `o` (object)

Returns `boolean`.

### `DateTime.local()`

Create a local DateTime

- `year` (number, optional): The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used
- `month` (number, optional, default 1): The month, 1-indexed
- `day` (number, optional, default 1): The day of the month, 1-indexed
- `hour` (number, optional, default 0): The hour of the day, in 24-hour time
- `minute` (number, optional, default 0): The minute of the hour, meaning a number between 0 and 59
- `second` (number, optional, default 0): The second of the minute, meaning a number between 0 and 59
- `millisecond` (number, optional, default 0): The millisecond of the second, meaning a number between 0 and 999

Returns `DateTime`.

```javascript
{{ $now }}
```

Result (DateTime):

```json
"2026-11-26T14:30:00.000Z"
```

```javascript
{{ $now.constructor.local({ zone: "America/New_York" }) }}
```

Result (DateTime):

```json
"2026-11-26T09:30:00.000-05:00"
```

```javascript
{{ $now.constructor.local(2017) }}
```

Result (DateTime):

```json
"2017-01-01T00:00:00.000Z"
```

### `DateTime.max(...dateTimes)`

Return the max of several date times

- `dateTimes` (...DateTime): the DateTimes from which to choose the maximum

Returns `DateTime`.

### `DateTime.min(...dateTimes)`

Return the min of several date times

- `dateTimes` (...DateTime): the DateTimes from which to choose the minimum

Returns `DateTime`.

### `DateTime.now()`

Create a DateTime for the current instant, in the system's time zone.

Use Settings to override these default values if needed.

Returns `DateTime`.

```javascript
{{ $now.toISO() }}
```

Result (string):

```json
"2026-11-26T14:30:00.000Z"
```

### `DateTime.parseFormatForOpts(formatOpts, localeOpts = {})`

Produce the format string for a set of options

- `formatOpts`
- `localeOpts`

Returns `string`.

### `DateTime.TIME_24_SIMPLE`

`DateTime#toLocaleString` format like '09:30', always 24-hour.

### `DateTime.TIME_24_WITH_LONG_OFFSET`

`DateTime#toLocaleString` format like '09:30:23 Eastern Daylight Time', always 24-hour.

### `DateTime.TIME_24_WITH_SECONDS`

`DateTime#toLocaleString` format like '09:30:23', always 24-hour.

### `DateTime.TIME_24_WITH_SHORT_OFFSET`

`DateTime#toLocaleString` format like '09:30:23 EDT', always 24-hour.

### `DateTime.TIME_SIMPLE`

`DateTime#toLocaleString` format like '09:30 AM'. Only 12-hour if the locale is.

### `DateTime.TIME_WITH_LONG_OFFSET`

`DateTime#toLocaleString` format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.

### `DateTime.TIME_WITH_SECONDS`

`DateTime#toLocaleString` format like '09:30:23 AM'. Only 12-hour if the locale is.

### `DateTime.TIME_WITH_SHORT_OFFSET`

`DateTime#toLocaleString` format like '09:30:23 AM EDT'. Only 12-hour if the locale is.

### `DateTime.utc()`

Create a DateTime in UTC

- `year` (number, optional): The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used
- `month` (number, optional, default 1): The month, 1-indexed
- `day` (number, optional, default 1): The day of the month
- `hour` (number, optional, default 0): The hour of the day, in 24-hour time
- `minute` (number, optional, default 0): The minute of the hour, meaning a number between 0 and 59
- `second` (number, optional, default 0): The second of the minute, meaning a number between 0 and 59
- `millisecond` (number, optional, default 0): The millisecond of the second, meaning a number between 0 and 999
- `options` (Object): configuration options for the DateTime
- `options.locale` (string, optional): a locale to set on the resulting DateTime instance
- `options.outputCalendar` (string, optional): the output calendar to set on the resulting DateTime instance
- `options.numberingSystem` (string, optional): the numbering system to set on the resulting DateTime instance
- `options.weekSettings` (string, optional): the week settings to set on the resulting DateTime instance

Returns `DateTime`.

```javascript
{{ $now.constructor.utc() }}
```

Result (DateTime):

```json
"2026-11-26T14:30:00.000Z"
```

```javascript
{{ $now.constructor.utc(2017) }}
```

Result (DateTime):

```json
"2017-01-01T00:00:00.000Z"
```

```javascript
{{ $now.constructor.utc(2017, 3) }}
```

Result (DateTime):

```json
"2017-03-01T00:00:00.000Z"
```

## Read parts

### `$now.day`

Get the day of the month (1-30ish).

```javascript
{{ $now.constructor.local(2017, 5, 25).day }}
```

Result (number):

```json
25
```

### `$now.daysInMonth`

Returns the number of days in this DateTime's month

```javascript
{{ $now.constructor.local(2016, 2).daysInMonth }}
```

Result (number):

```json
29
```

```javascript
{{ $now.constructor.local(2016, 3).daysInMonth }}
```

Result (number):

```json
31
```

### `$now.daysInYear`

Returns the number of days in this DateTime's year

```javascript
{{ $now.constructor.local(2016).daysInYear }}
```

Result (number):

```json
366
```

```javascript
{{ $now.constructor.local(2013).daysInYear }}
```

Result (number):

```json
365
```

### `$now.hour`

Get the hour of the day (0-23).

```javascript
{{ $now.constructor.local(2017, 5, 25, 9).hour }}
```

Result (number):

```json
9
```

### `$now.invalidExplanation`

Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid

```javascript
{{ $now.invalidExplanation }}
```

Result (null):

```json
null
```

### `$now.invalidReason`

Returns an error code if this DateTime is invalid, or null if the DateTime is valid

```javascript
{{ $now.invalidReason }}
```

Result (null):

```json
null
```

### `$now.isInDST`

Get whether the DateTime is in a DST.

```javascript
{{ $now.isInDST }}
```

Result (boolean):

```json
false
```

### `$now.isInLeapYear`

Returns true if this DateTime is in a leap year, false otherwise

```javascript
{{ $now.constructor.local(2016).isInLeapYear }}
```

Result (boolean):

```json
true
```

```javascript
{{ $now.constructor.local(2013).isInLeapYear }}
```

Result (boolean):

```json
false
```

### `$now.isOffsetFixed`

Get whether this zone's offset ever changes, as in a DST.

```javascript
{{ $now.isOffsetFixed }}
```

Result (boolean):

```json
true
```

### `$now.isValid`

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

```javascript
{{ $now.isValid }}
```

Result (boolean):

```json
true
```

### `$now.isWeekend`

Returns true if this date is on a weekend according to the locale, false otherwise

Returns `boolean`.

```javascript
{{ $now.isWeekend }}
```

Result (boolean):

```json
false
```

### `$now.locale`

Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime

```javascript
{{ $now.locale }}
```

Result (string):

```json
"en-US"
```

### `$now.localWeekday`

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,

Returns `number`.

```javascript
{{ $now.localWeekday }}
```

Result (number):

```json
5
```

### `$now.localWeekNumber`

Get the week number of the week year according to the locale. Different locales assign week numbers differently,
because 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.

Returns `number`.

```javascript
{{ $now.localWeekNumber }}
```

Result (number):

```json
48
```

### `$now.localWeekYear`

Get the week year according to the locale. Different locales assign week numbers (and therefor week years)
differently, see localWeekNumber.

Returns `number`.

```javascript
{{ $now.localWeekYear }}
```

Result (number):

```json
2026
```

### `$now.millisecond`

Get the millisecond of the second (0-999).

```javascript
{{ $now.constructor.local(2017, 5, 25, 9, 30, 52, 654).millisecond }}
```

Result (number):

```json
654
```

### `$now.minute`

Get the minute of the hour (0-59).

```javascript
{{ $now.constructor.local(2017, 5, 25, 9, 30).minute }}
```

Result (number):

```json
30
```

### `$now.month`

Get the month (1-12).

```javascript
{{ $now.constructor.local(2017, 5, 25).month }}
```

Result (number):

```json
5
```

### `$now.monthLong`

Get the human readable long month name, such as 'October'.
Defaults to the system's locale if no locale has been specified

```javascript
{{ $now.constructor.local(2017, 10, 30).monthLong }}
```

Result (string):

```json
"October"
```

### `$now.monthShort`

Get the human readable short month name, such as 'Oct'.
Defaults to the system's locale if no locale has been specified

```javascript
{{ $now.constructor.local(2017, 10, 30).monthShort }}
```

Result (string):

```json
"Oct"
```

### `$now.numberingSystem`

Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime

```javascript
{{ $now.numberingSystem }}
```

Result (null):

```json
null
```

### `$now.offset`

Get the UTC offset of this DateTime in minutes

```javascript
{{ $now.offset }}
```

Result (number):

```json
0
```

```javascript
{{ $now.constructor.utc().offset }}
```

Result (number):

```json
0
```

### `$now.offsetNameLong`

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

```javascript
{{ $now.offsetNameLong }}
```

Result (string):

```json
"UTC"
```

### `$now.offsetNameShort`

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

```javascript
{{ $now.offsetNameShort }}
```

Result (string):

```json
"UTC"
```

### `$now.ordinal`

Get the ordinal (meaning the day of the year)

```javascript
{{ $now.constructor.local(2017, 5, 25).ordinal }}
```

Result (number):

```json
145
```

### `$now.outputCalendar`

Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime

```javascript
{{ $now.outputCalendar }}
```

Result (null):

```json
null
```

### `$now.quarter`

Get the quarter

```javascript
{{ $now.constructor.local(2017, 5, 25).quarter }}
```

Result (number):

```json
2
```

### `$now.second`

Get the second of the minute (0-59).

```javascript
{{ $now.constructor.local(2017, 5, 25, 9, 30, 52).second }}
```

Result (number):

```json
52
```

### `$now.weekday`

Get the day of the week.
1 is Monday and 7 is Sunday

```javascript
{{ $now.constructor.local(2014, 11, 31).weekday }}
```

Result (number):

```json
null
```

### `$now.weekdayLong`

Get the human readable long weekday, such as 'Monday'.
Defaults to the system's locale if no locale has been specified

```javascript
{{ $now.constructor.local(2017, 10, 30).weekdayLong }}
```

Result (string):

```json
"Monday"
```

### `$now.weekdayShort`

Get the human readable short weekday, such as 'Mon'.
Defaults to the system's locale if no locale has been specified

```javascript
{{ $now.constructor.local(2017, 10, 30).weekdayShort }}
```

Result (string):

```json
"Mon"
```

### `$now.weekNumber`

Get the week number of the week year (1-52ish).

```javascript
{{ $now.constructor.local(2017, 5, 25).weekNumber }}
```

Result (number):

```json
21
```

### `$now.weeksInLocalWeekYear`

Returns the number of weeks in this DateTime's local week year

```javascript
{{ $now.constructor.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear }}
```

Result (number):

```json
52
```

```javascript
{{ $now.constructor.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear }}
```

Result (number):

```json
53
```

### `$now.weeksInWeekYear`

Returns the number of weeks in this DateTime's year

```javascript
{{ $now.constructor.local(2004).weeksInWeekYear }}
```

Result (number):

```json
53
```

```javascript
{{ $now.constructor.local(2013).weeksInWeekYear }}
```

Result (number):

```json
52
```

### `$now.weekYear`

Get the week year

```javascript
{{ $now.constructor.local(2014, 12, 31).weekYear }}
```

Result (number):

```json
2015
```

### `$now.year`

Get the year

```javascript
{{ $now.constructor.local(2017, 5, 25).year }}
```

Result (number):

```json
2017
```

### `$now.zone`

Get the time zone associated with this DateTime.

```javascript
{{ $now.zone }}
```

Result (object):

```json
{
  "fixed": 0
}
```

### `$now.zoneName`

Get the name of the time zone.

```javascript
{{ $now.zoneName }}
```

Result (string):

```json
"UTC"
```

## Transform and format

### `$now.diff(otherDateTime, unit = "milliseconds", opts = {})`

Return the difference between two DateTimes as a Duration.

- `otherDateTime` (DateTime): the DateTime to compare this one to
- `unit` (string|string[], optional, default ['milliseconds'): ] - the unit or array of units (such as 'hours' or 'days') to include in the duration.
- `opts` (Object): options that affect the creation of the Duration
- `opts.conversionAccuracy` (string, optional, default 'casual'): the conversion system to use

Returns `Duration`.

### `$now.diffNow(unit = "milliseconds", opts = {})`

Return the difference between this DateTime and right now.
See `DateTime#diff`

- `unit` (string|string[], optional, default ['milliseconds'): ] - the unit or units units (such as 'hours' or 'days') to include in the duration
- `opts` (Object): options that affect the creation of the Duration
- `opts.conversionAccuracy` (string, optional, default 'casual'): the conversion system to use

Returns `Duration`.

### `$now.endOf(unit, opts)`

"Set" this DateTime to the end (meaning the last millisecond) of a unit of time

- `unit` (string): The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.
- `opts` (Object): options
- `opts.useLocaleWeeks` (boolean, optional, default false): If true, use weeks based on the locale, i.e. use the locale-dependent start of the week

Returns `DateTime`.

```javascript
{{ $now.constructor.local(2014, 3, 3).endOf('month').toISO() }}
```

Result (string):

```json
"2014-03-31T23:59:59.999Z"
```

```javascript
{{ $now.constructor.local(2014, 3, 3).endOf('year').toISO() }}
```

Result (string):

```json
"2014-12-31T23:59:59.999Z"
```

```javascript
{{ $now.constructor.local(2014, 3, 3).endOf('week').toISO() }}
```

Result (string):

```json
"2014-03-09T23:59:59.999Z"
```

### `$now.equals(other)`

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`.

- `other` (DateTime): the other DateTime

Returns `boolean`.

### `$now.get(unit)`

Get the value of unit.

- `unit` (string): a unit such as 'minute' or 'day'

Returns `number`.

```javascript
{{ $now.constructor.local(2017, 7, 4).get('month') }}
```

Result (number):

```json
7
```

```javascript
{{ $now.constructor.local(2017, 7, 4).get('day') }}
```

Result (number):

```json
4
```

### `$now.getPossibleOffsets()`

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.

Returns `DateTime[]`.

```javascript
{{ $now.getPossibleOffsets() }}
```

Result (list):

```json
[
  "2026-11-26T14:30:00.000Z"
]
```

### `$now.hasSame(otherDateTime, unit, opts)`

Return whether this DateTime is in the same unit of time as another DateTime.
Higher-order units must also be identical for this function to return `true`.
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.

- `otherDateTime` (DateTime): the other DateTime
- `unit` (string): the unit of time to check sameness on
- `opts` (Object): options
- `opts.useLocaleWeeks` (boolean, optional, default false): If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used

Returns `boolean`.

### `$now.minus(duration)`

Subtract a period of time to this DateTime and return the resulting DateTime
See `DateTime#plus`

- `duration` (Duration|Object|number): The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()
   @return {DateTime}

### `$now.plus(duration)`

Add a period of time to this DateTime and return the resulting DateTime

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.

- `duration` (Duration|Object|number): The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()

Returns `DateTime`.

```javascript
{{ $now.plus(123) }}
```

Result (DateTime):

```json
"2026-11-26T14:30:00.123Z"
```

```javascript
{{ $now.plus({ minutes: 15 }) }}
```

Result (DateTime):

```json
"2026-11-26T14:45:00.000Z"
```

```javascript
{{ $now.plus({ days: 1 }) }}
```

Result (DateTime):

```json
"2026-11-27T14:30:00.000Z"
```

### `$now.reconfigure({ locale, numberingSystem, outputCalendar } = {})`

"Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.

- `properties` (Object): the properties to set

Returns `DateTime`.

```javascript
{{ $now.constructor.local(2017, 5, 25).reconfigure({ locale: 'en-GB' }) }}
```

Result (DateTime):

```json
"2017-05-25T00:00:00.000Z"
```

### `$now.resolvedLocaleOptions(opts = {})`

Returns the resolved Intl options for this DateTime.
This is useful in understanding the behavior of formatting methods

- `opts` (Object): the same options as toLocaleString

Returns `Object`.

### `$now.set(values)`

"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`.

- `values` (Object): a mapping of units to numbers

Returns `DateTime`.

### `$now.setLocale(locale)`

"Set" the locale. Returns a newly-constructed DateTime.
Just a convenient alias for reconfigure({ locale })

Returns `DateTime`.

```javascript
{{ $now.constructor.local(2017, 5, 25).setLocale('en-GB') }}
```

Result (DateTime):

```json
"2017-05-25T00:00:00.000Z"
```

### `$now.setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {})`

"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.

- `zone` (string|Zone, optional, default 'local'): 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 `DateTime#Zone` class.
- `opts` (Object): options
- `opts.keepLocalTime` (boolean, optional, default false): If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.

Returns `DateTime`.

### `$now.startOf(unit, { useLocaleWeeks = false } = {})`

"Set" this DateTime to the beginning of a unit of time.

- `unit` (string): The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.
- `opts` (Object): options
- `opts.useLocaleWeeks` (boolean, optional, default false): If true, use weeks based on the locale, i.e. use the locale-dependent start of the week

Returns `DateTime`.

```javascript
{{ $now.constructor.local(2014, 3, 3).startOf('month').toISODate() }}
```

Result (string):

```json
"2014-03-01"
```

```javascript
{{ $now.constructor.local(2014, 3, 3).startOf('year').toISODate() }}
```

Result (string):

```json
"2014-01-01"
```

```javascript
{{ $now.constructor.local(2014, 3, 3).startOf('week').toISODate() }}
```

Result (string):

```json
"2014-03-03"
```

### `$now.toBSON()`

Returns a BSON serializable equivalent to this DateTime.

Returns `Date`.

```javascript
{{ $now.toBSON() }}
```

Result (object):

```json
"2026-11-26T14:30:00.000Z"
```

### `$now.toFormat(fmt, opts = {})`

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.

- `fmt` (string): the format string
- `opts` (Object): opts to override the configuration options on this DateTime

Returns `string`.

```javascript
{{ $now.toFormat('yyyy LLL dd') }}
```

Result (string):

```json
"2026 Nov 26"
```

```javascript
{{ $now.setLocale('fr').toFormat('yyyy LLL dd') }}
```

Result (string):

```json
"2026 nov. 26"
```

```javascript
{{ $now.toFormat('yyyy LLL dd', { locale: "fr" }) }}
```

Result (string):

```json
"2026 nov. 26"
```

### `$now.toHTTP()`

Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.
Specifically, the string conforms to RFC 1123.

Returns `string`.

```javascript
{{ $now.constructor.utc(2014, 7, 13).toHTTP() }}
```

Result (string):

```json
"Sun, 13 Jul 2014 00:00:00 GMT"
```

```javascript
{{ $now.constructor.utc(2014, 7, 13, 19).toHTTP() }}
```

Result (string):

```json
"Sun, 13 Jul 2014 19:00:00 GMT"
```

### `$now.toISO({ format = "extended", suppressSeconds = false, suppressMilliseconds = false, includeOffset = true, extendedZone = false, precision = "milliseconds", } = {})`

Returns an ISO 8601-compliant string representation of this DateTime

- `opts` (Object): options
- `opts.suppressMilliseconds` (boolean, optional, default false): exclude milliseconds from the format if they're 0
- `opts.suppressSeconds` (boolean, optional, default false): exclude seconds from the format if they're 0
- `opts.includeOffset` (boolean, optional, default true): include the offset, such as 'Z' or '-04:00'
- `opts.extendedZone` (boolean, optional, default false): add the time zone format extension
- `opts.format` (string, optional, default 'extended'): choose between the basic and extended format
- `opts.precision` (string, optional, default 'milliseconds'): truncate output to desired presicion: 'years', 'months', 'days', 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.

Returns `string|null`.

```javascript
{{ $now.constructor.utc(1983, 5, 25).toISO() }}
```

Result (string):

```json
"1983-05-25T00:00:00.000Z"
```

```javascript
{{ $now.toISO() }}
```

Result (string):

```json
"2026-11-26T14:30:00.000Z"
```

```javascript
{{ $now.toISO({ includeOffset: false }) }}
```

Result (string):

```json
"2026-11-26T14:30:00.000"
```

### `$now.toISODate({ format = "extended", precision = "day" } = {})`

Returns an ISO 8601-compliant string representation of this DateTime's date component

- `opts` (Object): options
- `opts.format` (string, optional, default 'extended'): choose between the basic and extended format
- `opts.precision` (string, optional, default 'day'): truncate output to desired precision: 'years', 'months', or 'days'.

Returns `string|null`.

```javascript
{{ $now.constructor.utc(1982, 5, 25).toISODate() }}
```

Result (string):

```json
"1982-05-25"
```

```javascript
{{ $now.constructor.utc(1982, 5, 25).toISODate({ format: 'basic' }) }}
```

Result (string):

```json
"19820525"
```

```javascript
{{ $now.constructor.utc(1982, 5, 25).toISODate({ precision: 'month' }) }}
```

Result (string):

```json
"1982-05"
```

### `$now.toISOTime({ suppressMilliseconds = false, suppressSeconds = false, includeOffset = true, includePrefix = false, extendedZone = false, format = "extended", precision = "milliseconds", } = {})`

Returns an ISO 8601-compliant string representation of this DateTime's time component

- `opts` (Object): options
- `opts.suppressMilliseconds` (boolean, optional, default false): exclude milliseconds from the format if they're 0
- `opts.suppressSeconds` (boolean, optional, default false): exclude seconds from the format if they're 0
- `opts.includeOffset` (boolean, optional, default true): include the offset, such as 'Z' or '-04:00'
- `opts.extendedZone` (boolean, optional, default true): add the time zone format extension
- `opts.includePrefix` (boolean, optional, default false): include the `T` prefix
- `opts.format` (string, optional, default 'extended'): choose between the basic and extended format
- `opts.precision` (string, optional, default 'milliseconds'): truncate output to desired presicion: 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.

Returns `string`.

```javascript
{{ $now.constructor.utc().set({ hour: 7, minute: 34 }).toISOTime() }}
```

Result (string):

```json
"07:34:00.000Z"
```

```javascript
{{ $now.constructor.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) }}
```

Result (string):

```json
"07:34Z"
```

```javascript
{{ $now.constructor.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) }}
```

Result (string):

```json
"073400.000Z"
```

### `$now.toISOWeekDate()`

Returns an ISO 8601-compliant string representation of this DateTime's week date

Returns `string`.

```javascript
{{ $now.constructor.utc(1982, 5, 25).toISOWeekDate() }}
```

Result (string):

```json
"1982-W21-2"
```

### `$now.toJSDate()`

Returns a JavaScript Date equivalent to this DateTime.

Returns `Date`.

```javascript
{{ $now.toJSDate() }}
```

Result (object):

```json
"2026-11-26T14:30:00.000Z"
```

### `$now.toJSON()`

Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.

Returns `string`.

```javascript
{{ $now.toJSON() }}
```

Result (string):

```json
"2026-11-26T14:30:00.000Z"
```

### `$now.toLocal()`

"Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.

Equivalent to `setZone('local')`

Returns `DateTime`.

```javascript
{{ $now.toLocal() }}
```

Result (DateTime):

```json
"2026-11-26T14:30:00.000Z"
```

### `$now.toLocaleParts(opts = {})`

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

- `opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.`

```javascript
{{ $now.toLocaleParts() }}
```

Result (list):

```json
[
  {
    "type": "month",
    "value": "11"
  },
  {
    "type": "literal",
    "value": "/"
  },
  {
    "type": "day",
    "value": "26"
  },
  {
    "type": "literal",
    "value": "/"
  },
  {
    "type": "year",
    "value": "2026"
  }
]
```

### `$now.toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {})`

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`.
The exact behavior of this method is browser-specific, but in general it will return an appropriate representation
of the DateTime in the assigned locale.
Defaults to the system's locale if no locale has been specified

- `formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options`
- `opts` (Object): opts to override the configuration options on this DateTime

Returns `string`.

```javascript
{{ $now.toLocaleString() }}
```

Result (string):

```json
"11/26/2026"
```

```javascript
{{ $now.setLocale('en-gb').toLocaleString() }}
```

Result (string):

```json
"26/11/2026"
```

```javascript
{{ $now.toLocaleString($now.constructor.DATE_FULL) }}
```

Result (string):

```json
"November 26, 2026"
```

### `$now.toMillis()`

Returns the epoch milliseconds of this DateTime.

Returns `number`.

```javascript
{{ $now.toMillis() }}
```

Result (number):

```json
1795703400000
```

### `$now.toObject(opts = {})`

Returns a JavaScript object with this DateTime's year, month, day, and so on.

- `opts - options for generating the object`
- `opts.includeConfig` (boolean, optional, default false): include configuration attributes in the output

Returns `Object`.

```javascript
{{ $now.toObject() }}
```

Result (object):

```json
{
  "year": 2026,
  "month": 11,
  "day": 26,
  "hour": 14,
  "minute": 30,
  "second": 0,
  "millisecond": 0
}
```

### `$now.toRelative(options = {})`

Returns a string representation of a this time relative to now, such as "in two days". Can only internationalize if your
platform supports Intl.RelativeTimeFormat. Rounds towards zero by default.

- `options` (Object): options that affect the output
- `options.base` (DateTime, optional, default DateTime.now()): the DateTime to use as the basis to which this time is compared. Defaults to now.
- `options.style` (string, optional, default "long"): the style of units, must be "long", "short", or "narrow"
- `options.unit` (string|string[]): use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds"
- `options.round` (boolean, optional, default true): whether to round the numbers in the output.
- `options.rounding` (string, optional, default "trunc"): rounding method to use when rounding the numbers in the output. Can be "trunc" (toward zero), "expand" (away from zero), "round", "floor", or "ceil".
- `options.padding` (number, optional, default 0): padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.
- `options.locale` (string): override the locale of this DateTime
- `options.numberingSystem` (string): override the numberingSystem of this DateTime. The Intl system may choose not to honor this

```javascript
{{ $now.plus({ days: 1 }).toRelative() }}
```

Result (string):

```json
"in 1 day"
```

```javascript
{{ $now.setLocale("es").toRelative({ days: 1 }) }}
```

Result (string):

```json
"dentro de 0 segundos"
```

```javascript
{{ $now.plus({ days: 1 }).toRelative({ locale: "fr" }) }}
```

Result (string):

```json
"dans 1 jour"
```

### `$now.toRelativeCalendar(options = {})`

Returns a string representation of this date relative to today, such as "yesterday" or "next month".
Only internationalizes on platforms that supports Intl.RelativeTimeFormat.

- `options` (Object): options that affect the output
- `options.base` (DateTime, optional, default DateTime.now()): the DateTime to use as the basis to which this time is compared. Defaults to now.
- `options.locale` (string): override the locale of this DateTime
- `options.unit` (string): use a specific unit; if omitted, the method will pick the unit. Use one of "years", "quarters", "months", "weeks", or "days"
- `options.numberingSystem` (string): override the numberingSystem of this DateTime. The Intl system may choose not to honor this

```javascript
{{ $now.plus({ days: 1 }).toRelativeCalendar() }}
```

Result (string):

```json
"tomorrow"
```

```javascript
{{ $now.setLocale("es").plus({ days: 1 }).toRelative() }}
```

Result (string):

```json
"dentro de 1 día"
```

```javascript
{{ $now.plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) }}
```

Result (string):

```json
"demain"
```

### `$now.toRFC2822()`

Returns an RFC 2822-compatible string representation of this DateTime

Returns `string`.

```javascript
{{ $now.constructor.utc(2014, 7, 13).toRFC2822() }}
```

Result (string):

```json
"Sun, 13 Jul 2014 00:00:00 +0000"
```

```javascript
{{ $now.constructor.local(2014, 7, 13).toRFC2822() }}
```

Result (string):

```json
"Sun, 13 Jul 2014 00:00:00 +0000"
```

### `$now.toSeconds()`

Returns the epoch seconds (including milliseconds in the fractional part) of this DateTime.

Returns `number`.

```javascript
{{ $now.toSeconds() }}
```

Result (number):

```json
1795703400
```

### `$now.toSQL(opts = {})`

Returns a string representation of this DateTime appropriate for use in SQL DateTime

- `opts` (Object): options
- `opts.includeZone` (boolean, optional, default false): include the zone, such as 'America/New_York'. Overrides includeOffset.
- `opts.includeOffset` (boolean, optional, default true): include the offset, such as 'Z' or '-04:00'
- `opts.includeOffsetSpace` (boolean, optional, default true): include the space between the time and the offset, such as '05:15:16.345 -04:00'

Returns `string`.

```javascript
{{ $now.constructor.utc(2014, 7, 13).toSQL() }}
```

Result (string):

```json
"2014-07-13 00:00:00.000 Z"
```

```javascript
{{ $now.constructor.local(2014, 7, 13).toSQL() }}
```

Result (string):

```json
"2014-07-13 00:00:00.000 Z"
```

```javascript
{{ $now.constructor.local(2014, 7, 13).toSQL({ includeOffset: false }) }}
```

Result (string):

```json
"2014-07-13 00:00:00.000"
```

### `$now.toSQLDate()`

Returns a string representation of this DateTime appropriate for use in SQL Date

Returns `string|null`.

```javascript
{{ $now.constructor.utc(2014, 7, 13).toSQLDate() }}
```

Result (string):

```json
"2014-07-13"
```

### `$now.toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {})`

Returns a string representation of this DateTime appropriate for use in SQL Time

- `opts` (Object): options
- `opts.includeZone` (boolean, optional, default false): include the zone, such as 'America/New_York'. Overrides includeOffset.
- `opts.includeOffset` (boolean, optional, default true): include the offset, such as 'Z' or '-04:00'
- `opts.includeOffsetSpace` (boolean, optional, default true): include the space between the time and the offset, such as '05:15:16.345 -04:00'

Returns `string`.

```javascript
{{ $now.constructor.utc().toSQL() }}
```

Result (string):

```json
"2026-11-26 14:30:00.000 Z"
```

```javascript
{{ $now.toSQL() }}
```

Result (string):

```json
"2026-11-26 14:30:00.000 Z"
```

```javascript
{{ $now.toSQL({ includeOffset: false }) }}
```

Result (string):

```json
"2026-11-26 14:30:00.000"
```

### `$now.toString()`

Returns a string representation of this DateTime appropriate for debugging

Returns `string`.

```javascript
{{ $now.toString() }}
```

Result (string):

```json
"2026-11-26T14:30:00.000Z"
```

### `$now.toUnixInteger()`

Returns the epoch seconds (as a whole number) of this DateTime.

Returns `number`.

```javascript
{{ $now.toUnixInteger() }}
```

Result (number):

```json
1795703400
```

### `$now.toUTC(offset = 0, opts = {})`

"Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime.

Equivalent to `DateTime#setZone`('utc')

- `offset` (number, optional, default 0): optionally, an offset from UTC in minutes
- `opts` (Object, optional, default {}): options to pass to `setZone()`

Returns `DateTime`.

```javascript
{{ $now.toUTC() }}
```

Result (DateTime):

```json
"2026-11-26T14:30:00.000Z"
```

### `$now.until(otherDateTime)`

Return an Interval spanning between this DateTime and another DateTime

- `otherDateTime` (DateTime): the other end point of the Interval

Returns `Interval|DateTime`.

### `$now.valueOf()`

Returns the epoch milliseconds of this DateTime. Alias of `DateTime#toMillis`

Returns `number`.

```javascript
{{ $now.valueOf() }}
```

Result (number):

```json
1795703400000
```
