VeloDB Cloud
SQL Manual
Functions
date-time-functions
minutes_sub

minutes_sub

Description

Syntax:

DATETIME MINUTES_SUB(DATETIME date, INT minutes)

This function subtracts the specified number of minutes from the given date.

date can be of DATE or DATETIME type, and the returned result is of DATETIME type.

Example

mysql> select minutes_sub("2020-02-02 02:02:02", 1);
+---------------------------------------+
| minutes_sub('2020-02-02 02:02:02', 1) |
+---------------------------------------+
| 2020-02-02 02:01:02                   |
+---------------------------------------+

Keywords

MINUTES_SUB