3
How to calculate, the difference of hours in the Mysql?
3
How to calculate, the difference of hours in the Mysql?
4
To calculate the difference of hours in the Mysql use the Function TIMEDIFF
which returns the difference between the hours, along with the Function CURTIME()
that returns the current time.
Example:
SELECT TIMEDIFF(CURTIME(), hora) as dif
FROM conversas WHERE de=7 ORDER BY id DESC LIMIT 1;
References:
0
Man I was having the same doubt and it helped me
http://jquerydicas.blogspot.com/2013/11/mysql-diferenca-entre-datas.html
ex. SELECT TIMESTAMPDIFF(SECOND,cas_data_de_opening, cas_data_de_closing), usu_name, cas_status,cas_data_de_opening,cas_data_de_closing FROM case INNER JOIN user ON case.usu_id = user.usu_id WHERE cas_status = 'Closed' AND cas_id = 75
Browser other questions tagged mysql
You are not signed in. Login or sign up in order to post.