I\'m Trying to get the timediff from my table and convert it to hours (it\'s for an hourly billed service)
SELECT TIME_TO_SEC(TIMEDIFF(endDate,startDa
You can use UNIX_TIMESTAMP to do the calculation in SELECT query.
SELECT (UNIX_TIMESTAMP(endDate)-UNIX_TIMESTAMP(startDate))/3600 hour_diff
FROM tasks
UNIX_TIMESTAMP convert datetime to number of second from epoch. You can substract both timestamp to get difference in second. Divide it with 3600 will give you difference in hour.