# Time Operators

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [cloud-data-platform-full.txt](https://docs.redpanda.com/cloud-data-platform-full.txt)

---
title: Time Operators
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-connect-version: 4.93.0
latest-redpanda-tag: v26.1.9
docname: sql/sql-data-types/time-type/time-operators
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: sql/sql-data-types/time-type/time-operators.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/sql-data-types/time-type/time-operators.adoc
description: Time operators in Redpanda SQL perform various operations on dates, times, and intervals.
page-topic-type: reference
page-git-created-date: "2026-05-26"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-data-types/time-type/time-operators.md -->

Time operators in Redpanda SQL perform various operations on dates, times, and intervals.

## [](#date-integer)DATE + INTEGER

Add a specific number of days to a date.

Example:

```sql
select date '2022-03-15' + 14 as "result";
```

The result is the date 14 days after ‘2022-03-15’:

```sql
   result
------------
 2022-03-29
```

### [](#integer-date)INTEGER + DATE

Adding and multiplying time operators can also be done in reverse order. For example, you can add a number of days to a date in the format of `Integer + Date`.

```sql
select 14 + date '2022-03-15' AS "result";
```

This produces the same result: 14 days after ‘2022-03-15’ is ‘2022-03-29’:

```sql
   result
------------
 2022-03-29
```

## [](#date-interval)DATE + INTERVAL

Add a specified interval to a date.

Example:

```sql
select date '2022-03-15' + interval '3 months' as "result";
```

The result is the date three months after ‘2022-03-15’:

```sql
           result
----------------------------
 2022-06-15 00:00:00.000000
```

## [](#date-integer-2)DATE - INTEGER

Subtract a certain number of days from a date.

Example:

```sql
select date '2022-03-15' - 7 as "result";
```

The result is the date 7 days before ‘2022-03-15’:

```sql
   result
------------
 2022-03-08
```

## [](#date-interval-2)DATE - INTERVAL

Subtract a specified interval from a date.

Example:

```sql
select date '2022-03-15' - interval '2 hour' as "result";
```

The result is the timestamp two hours before ‘2022-03-15’:

```sql
           result
----------------------------
 2022-03-14 22:00:00.000000
```

## [](#date-date)DATE - DATE

Subtract dates.

Example:

```sql
select date '2023-03-15' - date '2023-01-10' as "result";
```

The number of days elapsed between ‘2023-03-15’ and ‘2023-01-10’ is 64 days.

```sql
 result
--------
     64
```

## [](#date-time)DATE + TIME

Add a time-of-day to a date.

Example:

```sql
select date '2010-05-20' + time '02:00' as "result";
```

The result is a timestamp combining the date and time:

```sql
           result
----------------------------
 2010-05-20 02:00:00.000000
```

## [](#time-interval)TIME + INTERVAL

Add a certain interval to a given time.

Example:

```sql
select time '12:30' + interval '1 hour' as "result";
```

The result is the time one hour after ‘12:30’:

```sql
     result
-----------------
 13:30:00.000000
```

## [](#time-interval-2)TIME - INTERVAL

Subtract a specified interval from a given time.

Example:

```sql
select time '18:45' - interval '45 minutes' as "result";
```

The result is the time 18:00:

```sql
     result
-----------------
 18:00:00.000000
```

## [](#time-time)TIME - TIME

Get a time difference by subtracting one time from another.

Example:

```sql
select time '10:00' - TIME '08:20' as "result";
```

In this example, the time difference between the two provided times is 1 hour and 40 minutes.

```sql
     result
-----------------
 01:40:00.000000
```

## [](#timestamp-interval)TIMESTAMP + INTERVAL

Add a timestamp and an interval.

Example:

```sql
select timestamp '2021-01-05 12:00:00' + interval '5 days' as "result";
```

The result is a new timestamp, 5 days after ‘2021-01-05 12:00:00’:

```sql
           result
----------------------------
 2021-01-10 12:00:00.000000
```

## [](#timestamp-interval-2)TIMESTAMP - INTERVAL

Subtract an interval from a timestamp.

Example:

```sql
select timestamp '2022-01-04 12:00:00' - interval '3 days' as "result";
```

In this example, it subtracts 3 days from ‘2022-01-04 12:00:00’.

```sql
           result
----------------------------
 2022-01-01 12:00:00.000000
```

## [](#timestamp-timestamp)TIMESTAMP - TIMESTAMP

Get an interval by subtracting one timestamp from another.

Example:

```sql
select timestamp '2022-01-05 18:30:00' - timestamp '2022-01-01 12:00:00' as "result";
```

It gives the interval between the two timestamps, 102 hours and 30 minutes.

```sql
      result
------------------
 102:30:00.000000
```

## [](#interval-interval)INTERVAL + INTERVAL

Add intervals.

Example:

```sql
select interval '2 months 2 days' + interval '6 days' as "result";
```

It adds 6 days to 2 days, resulting in a total of 2 months and 8 days.

```sql
    result
---------------
 2 mons 8 days
```

## [](#interval-interval-2)INTERVAL - INTERVAL

Subtract intervals.

Example:

```sql
select interval '2 months' - interval '20 days' as "result";
```

It subtracts 20 days from 2 months.

```sql
     result
-----------------
 2 mons -20 days
```

## [](#interval-integer)INTERVAL \* INTEGER

Multiply an interval by an integer.

Example:

```sql
select interval '2 hours' * 3 as "result";
```

It multiplies ‘2 hours’ by 3, the result is 6 hours.

```sql
     result
-----------------
 06:00:00.000000
```

## [](#interval-double-precision)INTERVAL \* DOUBLE PRECISION

Multiply an interval by a scalar.

Example:

```sql
select interval '2 hours' * 1.5 as "result";
```

It multiplies ‘2 hours’ by 1.5, and returns 3 hours.

```sql
    result
-----------------
 03:00:00.000000
```

## [](#interval-number)INTERVAL / NUMBER

Divide an interval by an integer or scalar.

### [](#divide-by-an-integer)Divide by an integer

```sql
select interval '1 hour' / 2 as "result";
```

It divides ‘1 hour’ by 2, and returns 30 minutes.

```sql
    result
-----------------
 00:30:00.000000
```

### [](#divide-by-a-scalar)Divide by a scalar

```sql
select interval '2 hours' / 1.5 as "result";
```

It divides ‘2 hours’ by 1.5, and returns 1 hour 20 minutes.

```sql
     result
-----------------
 01:20:00.000000
```