Created
January 2, 2014 12:32
-
-
Save italoveloso/8218567 to your computer and use it in GitHub Desktop.
Diff between dates - MySQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2) | |
Returns datetime_expr2 – datetime_expr1, where datetime_expr1 and datetime_expr2 are date or datetime expressions. One expression may be a date and the other a datetime; a date value is treated as a datetime having the time part '00:00:00' where necessary. The unit for the result (an integer) is given by the unit argument. | |
The unit argument can be: MICROSECOND (microseconds), SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or YEAR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment