php - Convert TIMEDIFF to hours plus minutes -
time1: 2013-08-26 16:33:00 time2: 2013-08-26 15:10:00 $query="update `flightschedule` set delay = minute(timediff(time1, time2)) `flightnum_arr`='".$flightnum_arr."';";
it saves value 23 delay. instead correct answer should 83 minutes. how it?
i think looking for:
$query="update `flightschedule` set delay = ceil((unix_timestamp(time1) - unix_timestamp(time2))/60) `flightnum_arr`='".$flightnum_arr."';";
alternatively, there time_to_sec function - and, since provides result in seconds, you'll need divide 60 too.
Comments
Post a Comment