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

# hours_add

> Adds hours to a date or datetime.

Adds hours to a date or datetime.

## Syntax

```Haskell theme={null}
DATETIME hours_add(DATETIME|DATE date, INT hours);
```

## Parameters

`date`: Base date or datetime.

`hours`: Hours to be added.

## Return value

Returns a DATETIME value.

NULL is returned when any of the input parameters is NULL.

## Examples

```Plain Text theme={null}
select hours_add('2022-01-01 01:01:01', 2);
+-------------------------------------+
| hours_add('2022-01-01 01:01:01', 2) |
+-------------------------------------+
| 2022-01-01 03:01:01                 |
+-------------------------------------+

select hours_add('2022-01-01 01:01:01', -1);
+--------------------------------------+
| hours_add('2022-01-01 01:01:01', -1) |
+--------------------------------------+
| 2022-01-01 00:01:01                  |
+--------------------------------------+

select hours_add('2022-01-01', 1);
+----------------------------+
| hours_add('2022-01-01', 1) |
+----------------------------+
| 2022-01-01 01:00:00        |
+----------------------------+
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.