MySQL calculates the two-date time difference function Timestampdiff usage, as long as a SQL statement can be done.
MySQL calculates the two-date time difference function Timestampdiff usage:
Grammar:
Timestampdiff (INTERVAL,DATETIME_EXPR1,DATETIME_EXPR2)
Description
Returns an integer difference between a date or datetime expression Datetime_expr1 and datetime_expr2the. The results of
The units are given by the interval parameter. The legal values for interval are the same as those listed in the Timestampadd () function description.
SELECT Timestampdiff(MONTH,'2009-10-01','2009-09-01');
SELECT Timestampdiff (MONTH, '2009-10-01', now ()), and the current time difference
Interval but: SECOND seconds SECONDS MINUTE minutes MINUTES HOUR time HOURS DayDay DaysMONTHmonth MONTHS YearYear years
MySQL calculates the time difference function