Mysql
 sql >> Database >  >> RDS >> Mysql

come calcolare il tempo rimanente rimasto con php e mysql?

Usa TIME_TO_SEC(TIMEDIFF(final_time, initial_time))

SELECT TIME_TO_SEC(TIMEDIFF('17:00:00', '09:00:00')) -- 28800

SELECT TIME_TO_SEC(TIMEDIFF('12:30:00', '12:00:00')) -- 1800
SELECT TIME_TO_SEC(TIMEDIFF('10:30:00', '10:15:00')) -- 900