时间:2021-07-01 10:21:17 帮助过:10人阅读
参考:https://blog.csdn.net/yiifaa/article/details/78611079
https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_microsecond
- mysql> SELECT TIMESTAMPDIFF(MONTH,‘2003-02-01‘,‘2003-05-01‘);
- -> 3
- mysql> SELECT TIMESTAMPDIFF(YEAR,‘2002-05-01‘,‘2001-01-01‘);
- -> -1
- mysql> SELECT TIMESTAMPDIFF(MINUTE,‘2003-02-01‘,‘2003-05-01 12:05:55‘);
- -> 128885