简体   繁体   English

如何从两个不同的日期计算员工超时时间 PHP

[英]How to calculate employee in time out time from two different days PHP

How can I determine the time in and time out of that employee on a particular date but employee worked on 01-01-2019 11.00 PM to 02-01-2019 07.00 AM .我如何确定该员工在特定日期的进出时间,但该员工在01-01-2019 11.00 PM 至02-01-2019 07.00 AM How can I calculate in out time for 01-01-2019如何计算01-01-2019进出时间

Can you please try the below mysql query你能试试下面的mysql查询吗

SELECT sec_to_time(sum(time_to_sec(timediff(time_out, time_in)))),user_id FROM test.time group by user_id;

This is my table这是我的桌子

user_id    time_in                   time_out
   1       2019-03-05 05:30:51        2019-03-05 05:45:51
   1       2019-03-05 05:50:51        2019-03-05 05:55:51

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM