Created
June 18, 2020 15:54
-
-
Save zerobugs-oficial/aef00989e6e1ec1dacdf4419a64395a6 to your computer and use it in GitHub Desktop.
MySQL: Calcular quantidade de dias, meses ou anos entre duas datas
This file contains 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
SELECT TIMESTAMPDIFF(MONTH,'2003-02-01','2003-05-01'); | |
SELECT TIMESTAMPDIFF(YEAR,'2002-05-01','2001-01-01'); | |
SELECT TIMESTAMPDIFF(DAY,'2003-02-01','2003-05-01'); | |
SELECT TIMESTAMPDIFF(MINUTE,'2003-02-01','2003-05-01 12:05:55'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment