SECONDS_SUB
seconds_subβ
descriptionβ
Syntaxβ
DATETIME SECONDS_SUB(DATETIME date, INT seconds)
Subtracts a specified number of seconds from a datetime or date
The parameter date can be DATETIME or DATE, and the return type is DATETIME.
exampleβ
mysql> select seconds_sub("2020-01-01 00:00:00", 1);
+---------------------------------------+
| seconds_sub('2020-01-01 00:00:00', 1) |
+---------------------------------------+
| 2019-12-31 23:59:59 |
+---------------------------------------+
keywordsβ
SECONDS_SUB