---
title: "SECOND"
description: "The SECOND SQL function extracts the seconds from a date/time."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/second
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/second
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)) --> SECOND[SECOND]:::quoted
    SECOND --> End((END))
```

## Purpose
The `SECOND` SQL function extracts the seconds from a date/time.

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

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

Returns: the seconds as an `int32`.

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

-------------------
6
```
The following example extracts the seconds from of date:
```sql
select second(to_date('20260101123456', 'YYYYMMDDHH24MISS'))

-------------------
56
```