In MySQL, the TIMESTAMP() function returns a datetime value based on the argument/s passed in. You can provide one argument or two. If you provide two, it adds the second one to the first and returns the result.
dates
SUBTIME() Examples – MySQL
In MySQL, you can use the SUBTIME() function to subtract a time value from a time or datetime expression.
The way it works is, you provide two arguments; the first is a time or datetime value, and the second is a time value. The SUBTIME() function then subtracts the second argument from the first one and returns the result.