mysql get date diff in months
SELECT TIMESTAMPDIFF(MONTH, '2012-05-05', '2012-06-15')
mysql get date diff in months
SELECT TIMESTAMPDIFF(MONTH, '2012-05-05', '2012-06-15')
mysql get date difference in hours
SELECT TIMESTAMPDIFF(HOUR, '2021-05-22 07:00:00', '2021-05-22 12:00:37') as time_diff_in_hours;
mysql date between two dates
-- With implicit CAST
SELECT * FROM my_table
WHERE my_date BETWEEN '2021-06-01 01:12:00' AND '2021-06-30 23:59:59';
-- is EQUIVALENT to
SELECT * FROM my_table
WHERE my_date >= '2021-06-01 01:12:00' AND my_col <= '2021-06-30 23:59:59';
mysql date diff in seconds
SELECT TIME_TO_SEC(TIMEDIFF('2021-05-22 12:00:00', '2021-05-22 12:00:37')) as diff_in_seconds;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us