SECOND()

Overview

Returns the seconds from a given time.

USAGE

SECOND(time)

Argument Name

Description

time

The time string or number to evaluate

DETAILS

SECOND() is a date-time function that returns the seconds from a given time argument.

The time argument can be in string (hh:mm:ss or hh:mm) or numeric (hhmmss) format. Both style of input can also specify fractional seconds after a decimal point.

The returned value of a valid time is in the range of 0 to 59. Any fractional seconds are discarded.

A NULL is returned if the argument is NULL or otherwise invalid.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT SECOND('12:01:30');
+--------------------+
| SECOND('12:01:30') |
+--------------------+
|                 30 |
+--------------------+
SELECT SECOND('12:01');
+-----------------+
| SECOND('12:01') |
+-----------------+
|               0 |
+-----------------+
SELECT SECOND('12:34:56.7890');
+-------------------------+
| SECOND('12:34:56.7890') |
+-------------------------+
|                      56 |
+-------------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES