mysql MySql function of two time difference function calculates the time difference between two dates

MySql function calculates the time difference between two dates

MySql function calculates the time difference between two dates
 
MySql two dates computing time difference function TIMESTAMPDIFF Usage: 
 
grammar: 
Java Code  
TIMESTAMPDIFF(interval,datetime_expr1,datetime_expr2)   
  www.2cto.com  
Description: 
Returns the integer difference between the date or date and time expression datetime_expr1 datetime_expr2the. As a result, the
unit interval is given by the parameters. with TIMESTAMPADD () function the same as the legal value of interval listed in the description. 
 
SELECT TIMESTAMPDIFF(MONTH,'2009-10-01','2009-09-01'); 
But the interval: 
SECOND seconds SECONDS 
MINUTE minutes MINUTES 
Time HOUR HOURS 
DAY 天 DAYS 
MONTH 月 MONTHS 
YEAR 年 YEARS
MySql function calculates the time difference between two dates
 
MySql two dates computing time difference function TIMESTAMPDIFF Usage: 
 
grammar: 
Java Code  
TIMESTAMPDIFF(interval,datetime_expr1,datetime_expr2)   
  www.2cto.com  
Description: 
Returns the integer difference between the date or date and time expression datetime_expr1 datetime_expr2the. As a result, the
unit interval is given by the parameters. with TIMESTAMPADD () function the same as the legal value of interval listed in the description. 
 
SELECT TIMESTAMPDIFF(MONTH,'2009-10-01','2009-09-01'); 
But the interval: 
SECOND seconds SECONDS 
MINUTE minutes MINUTES 
Time HOUR HOURS 
DAY 天 DAYS 
MONTH 月 MONTHS 
YEAR 年 YEARS
MySql function calculates the time difference between two dates
 
MySql two dates computing time difference function TIMESTAMPDIFF Usage: 
 
grammar: 
Java Code  
TIMESTAMPDIFF(interval,datetime_expr1,datetime_expr2)   
  www.2cto.com  
Description: 
Returns the integer difference between the date or date and time expression datetime_expr1 datetime_expr2the. As a result, the
unit interval is given by the parameters. with TIMESTAMPADD () function the same as the legal value of interval listed in the description. 
 
SELECT TIMESTAMPDIFF(MONTH,'2009-10-01','2009-09-01'); 
But the interval: 
SECOND seconds SECONDS 
MINUTE minutes MINUTES 
Time HOUR HOURS 
DAY 天 DAYS 
MONTH 月 MONTHS 
YEAR 年 YEARS
MySql function calculates the time difference between two dates
 
MySql two dates computing time difference function TIMESTAMPDIFF Usage: 
 
grammar: 
Java Code  
TIMESTAMPDIFF(interval,datetime_expr1,datetime_expr2)   
  www.2cto.com  
Description: 
Returns the integer difference between the date or date and time expression datetime_expr1 datetime_expr2the. As a result, the
unit interval is given by the parameters. with TIMESTAMPADD () function the same as the legal value of interval listed in the description. 
 
SELECT TIMESTAMPDIFF(MONTH,'2009-10-01','2009-09-01'); 
But the interval: 
SECOND seconds SECONDS 
MINUTE minutes MINUTES 
Time HOUR HOURS 
DAY 天 DAYS 
MONTH 月 MONTHS 
YEAR 年 YEARS

Guess you like

Origin www.cnblogs.com/penghuake/p/11736737.html