MySQL time computing is a project today and requires mysql time function computing. So I searched for the MySQL time function documentation and finally asked me to find it. Now I want to give it to you. In the MYSQL function, I find several time functions to call, where: SELECT SEC_TO_TIME (UNIX_TIMESTAMP (NOW ()-UNIX_TIMESTAMP ('2017-03-14 15:29:25 ')) FROM demo; is the difference between two time calculations. The conclusion is: 02:08:43 if you want to calculate the time addition and subtraction algorithm, use the MySQL INTERVAL function. Usage: 1) query data that is 25 minutes earlier than the current time select now ()-INTERVAL 25 MINUTE; 2) query data of the current time 25 minutes select now () + INTERVAL 5 MINUTE; function parsing Description: MySQL allows punctuation separators in any expr format. The recommended Delimiter is displayed in the table. If the date parameter is a DATE value, and your calculation only includes the YEAR, MONTH, and DAY sections (that is, there is no time section), the result is a DATE value. Otherwise, the result is a DATETIME value. If the expression at the other end is a date or datetime value, INTERVAL expr type is only allowed at both ends of the + operator. For the-operator, INTERVAL expr type is only allowed on the right side, because it is meaningless to extract a date or datetime value from a time INTERVAL.