---
title: "HOUR"
description: "The HOUR SQL function extract the hour from a date/time."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/hour
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/hour
updated: 2026-08-09T00:00:00Z
license: https://documentation.invantive.eu/en/
---

## Syntax
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> HOUR[HOUR]:::quoted
    HOUR --> End((END))
```

## Purpose
The `HOUR` SQL function extract the hour from a date/time.

See also [[DAY]], [[MICROSECOND]], [[MILLISECOND]], [[MINUTE]], [[MONTH]], [[SECOND]] and [[YEAR]].

Parameters:
- Input (`datetime`): the date/time to extract the hours from.

Returns: the hour as an `int32`.

## Examples
The following example extracts the hours from current system date/time in UTC:
```sql
select hour(sysdateutc)

-------------------
13
```
The following example extracts the hours from noon January 1, 2026:
```sql
select hour(to_date('20260101120000', 'YYYYMMDDHH24MISS'))

-------------------
12
```