所以这是我的代码
@foreach($myquery as $mydate)
<tr>
<td>{{date('l',strtotime($mydate->logon))}}</td>
<td>{{date('jS F, Y',strtotime($mydate->logon))}}</td>
<td>{{date('h:i A',strtotime($mydate->logon))}}</td>
<td>{{date('h:i A',strtotime($mydate->logoff))}}</td>
<td>{{$mydate->logon->diff($mydate->logoff)}}</td>
</tr>
@endforeach
我想要做的是获得登录和注销的区别。我只是使用此代码获得错误500,请帮助
答案 0 :(得分:0)
我的错,我忘记了日期尚未转换为字符串以便将其删除
@foreach($myquery as $mydate)
<tr>
<td>{{date('l',strtotime($mydate->logon))}}</td>
<td>{{date('jS F, Y',strtotime($mydate->logon))}}</td>
<td>{{$date1=date('h:i A',strtotime($mydate->logon))}}</td>
<td>{{$date2=date('h:i A',strtotime($mydate->logoff))}}</td>
<td>{{$date2-$date1}}</td>
</tr>
@endforeach