shiftCycle/demo.php

20 lines
689 B
PHP
Raw Permalink Normal View History

2020-10-24 16:45:07 -04:00
<?PHP
$conf = [
'shifts' => array('A','B','C'), //Crew designators in order starting at EPOCH
'timeZone' => 'America/New_York', //Local Time Zone
'startTime' => '07:30' //Shift start time in 24-hour format
];
//***********************************************************************************
require 'shiftCycle.php';
$shiftCycle = new shiftCycle($conf);
echo "Local Timestamp: " . $shiftCycle->timestamp . "<br/>";
echo "Whole days since EPOCH: " . $shiftCycle->daysSince . "<br/>";
echo "Cycles since EPOCH: " . $shiftCycle->cyclesSince . "<br/>";
echo "Day in cycle: " . ($shiftCycle->cyclePart + 1) . "<br/>";
echo "Crew on duty: " . $shiftCycle->currentShift . "<br/>";
?>