How to get time difference (in hours) between 2 dates
From MySQL DATEDIFF docs:
Only the date parts of the values are used in the calculation.
You will want to look at TIMEDIFF
This will give you the number of hours in the difference in times (assuming your time_c
fields are DATETIME or something similar)
SELECT HOUR(TIMEDIFF( (SELECT max(u1.time_c) FROM users u), (SELECT max(u2.time_c) FROM users u2)))