> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omni.co/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.omni.co/feedback

```json
{
  "path": "/analyze-explore/calculations/date-time",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Supported date & time functions

> Omni supports functions typically found in most spreadsheet applications such as Google Sheets. This reference details the date and time functions supported by Omni.

## DATE

Creates a date from day, month, and year components. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3092969).

```
DATE(year, month, day)
```

```
DATE(2022, 12, 22)
```

## DATEDIF

Finds the difference between two dates in specified units, such as days.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/6055612).

```
DATEDIF(start_date, end_date, "unit")
```

**Example**

```
DATEDIF(A1, B1, "M")
```

## DAY

Returns the day of the month from a date.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093040).

```
DAY(date)
```

**Example**

```
DAY("2022-12-22")
```

## DAYS

Finds the difference in days between two dates. Similar to [`DATEDIF`](#datedif).

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/9061296).

```
DAYS(end_date, start_date)
```

**Example**

```
DAYS(“2/28/2017”, “2/28/2016”)
```

## EOMONTH

Returns the date of the last day of a month from a date or datetime value. This function takes two arguments:

* `date_value` - The date from which to calculate the result
* `offset_months` - The number of months before (negative) or after (positive) the `date_value` to consider

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093044).

```
EOMONTH(date_value, offset_months)
```

**Example**

```
EOMONTH("3/1/2024", 0)
```

## HOUR

Returns the hour as a number from `0` (`12:00 A.M.`) to `23` (`11:00 P.M.`).

For more examples, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093045).

```
HOUR(time)
```

**Example**

```
HOUR(A1)HOUR("15:30")HOUR("20:49:59")
```

## MINUTE

Returns the minute as a number from `0` to `59`.

For more examples, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093048).

```
MINUTE(time)
```

**Example**

```
MINUTE(A1)MINUTE("15:30")MINUTE("20:49:59")
```

## MONTH

Returns the month (`1`-`12`) from a date.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093052).

```text theme={null}
MONTH(date)
```

**Example**

```text theme={null}
MONTH("2022-12-22")
```

## NETWORKDAYS

Returns the number of whole working days between `start_date` and `end_date`. Weekend days are excluded. **Note**: While similar to Excel, Omni's implementation of this function does not support the third `holidays` argument.

```
NETWORKDAYS(start_date,end_date)
```

<Info>
  Date arguments used in this function must be specified using one of the following methods:

  * The [DATE](#date) function, for example: `DATE(2025, 1, 1)`
  * As the result of another formula or function
  * As cell references (`A1`)
</Info>

**Example**

```
NETWORKDAYS(DATE(2025, 1, 1), DATE(2025, 2, 1))NETWORKDAYS(A1,B1)
```

## NOW

Returns the current date and time as a date-time value. To create a date without the current time, use [`TODAY`](#today).

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3092981).

```
NOW()
```

**Example**

```
NOW()
```

## SECOND

Returns the second as a number from `0` to `59`.

For more examples, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093054).

```
SECOND(time)
```

**Example**

```
SECOND(A1)
SECOND("20:49:59")
```

## TODAY

Returns the current date as a date value. Does not accept arguments. To create a date with the current time, use [`NOW`](#now).

For more examples, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3092984).

```
TODAY()
```

**Example**

```
TODAY()
```

## WEEKDAY

Returns the day of the week as a number from `1` to `7`, where `1` is equal to `Sunday`. The optional `return_type` argument controls the numbering scheme.

```
WEEKDAY(date, [return_type])
```

**Example**

```
WEEKDAY("2022-12-22")
WEEKDAY("2022-12-22", 2)
```

## WEEKNUM

Returns a number representing the week of the year where the provided date falls. This function accepts two arguments:

* `date` - The date for which to calculate the week number. Must be a date, a function returning a date type, or a number.
* `type` - **Optional**. A number representing the day that a week starts on. Defaults to `1` (Sunday).

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3294949).

```
WEEKNUM(date, [type])
```

**Example**

```
WEEKNUM("2022-12-22", 2)
```

## YEAR

Returns the year from a date.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093061).

```
YEAR(date)
```

**Example**

```
YEAR("2022-12-22")
```
