Convert HH:MM:SS string to number of minutes

后端 未结 8 633
醉梦人生
醉梦人生 2021-01-22 12:03

I have the below query.

select cast(dateadd(minute, datediff(minute, TimeIn, TimeOut), 0) as time(0) )

I get the results from two columns in th

8条回答
  •  醉话见心
    2021-01-22 12:45

    $time = '02:47:00';
    
    $time = explode(":",$time); 
    
    $total = ($a[0]*60)+$a[1];
    
    echo 'Minutes : '.$total;
    echo 'Seconds : '.$a[2];

提交回复
热议问题