1
I need to bring from my database a TIMEDIFF with field formatted like this: 12:50 (hours and minutes). I use the following excerpt:
CONCAT(HOUR(TIMEDIFF(Campo.expired,NOW())),":",MINUTE(TIMEDIFF(Campo.expired,NOW()))) AS expired
My problem is that when the time is only 1 digit, the result is like this: 2:4 (2 hours and 40 minutes). I need to display this date correctly, that is, 02:40.
I have tried using DATE_FORMAT inside CONCAT, unsuccessfully.
The column
expired
is what kind? How did you try to use theDATE_FORMAT
?– mateusalxd