示例#1
0
    echo $inTime->toTimeString();
    ?>
 

                                            </td>
                                            <td class="center"> 

                                            	<?php 
    $outTime = new Carbon\Carbon($data->logoutTime);
    echo $outTime->toTimeString();
    ?>
 

                                            </td>
                                            <td class="center"> <?php 
    $total = $inTime->diffInMinutes($outTime);
    echo $total;
    ?>
 
                                            </td>
                                        </tr>
                                        
                                    <?php 
    $i++;
}
?>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                            
示例#2
0
        
                // targetDate: {
                //     'day': 30,
                //     'month': 9,
                //     'year': 2015,
                //     'hour': 0,
                //     'min': 0,
                //     'sec': 0
                // },
                // omitWeeks: true

                <?php 
$launchingDateTime = !empty($global_params['launching_datetime']) ? $global_params['launching_datetime'] : '2017-01-01 00:00:00';
$datetime = new Carbon\Carbon($launchingDateTime);
$sec = $datetime->diffInSeconds() % 60;
$min = $datetime->diffInMinutes() % 60;
$hour = $datetime->diffInHours() % 24;
$day = $datetime->diffInDays() % 30;
$month = $datetime->diffInMonths() % 12;
$year = $datetime->diffInYears();
?>

                 targetOffset: {
                    'day':      {{ $day }},
                    'month':    {{ $month }},
                    'year':     {{ $year }},
                    'hour':     {{ $hour }},
                    'min':      {{ $min }},
                    'sec':      {{ $sec }}
                },
                omitWeeks: true