DATEDIFF()

Overview

Calculates the differences in days between two DATE arguments.

USAGE

DATEDIFF(timestamp, timestamp)

Argument Name

Description

timestamp

Two moments in time to compare

DETAILS

DATEDIFF() is a date-time function that returns the difference in days between two date arguments.

The second argument is subtracted from the first argument.

A NULL is returned if any argument is NULL.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT DATEDIFF('2020-03-01 23:59:59', '2020-02-01');
+-----------------------------------------------+
| DATEDIFF('2020-03-01 23:59:59', '2020-02-01') |
+-----------------------------------------------+
|                                            29 |
+-----------------------------------------------+

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