Created
March 18, 2013 14:59
-
-
Save tamboer/5187754 to your computer and use it in GitHub Desktop.
Zend_date functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$currentDate = new Zend_Date(); | |
$currentDate->setDate($taskDistribution["date"], "yyyy-MM-dd"); | |
$startTime = new Zend_Date(); | |
$startTime->setTime($taskDistribution["start_time"], "HH:mm:ss"); | |
$endTime = new Zend_Date(); | |
$endTime->setTime($taskDistribution["end_time"], "HH:mm:ss"); | |
if($endTime->toString('HH') == '00') | |
$endTime->setHour('24'); | |
$taskDayTotal += $endTime->sub($startTime)->toValue()/60/60; | |
$taskWeekTotal=0; | |
if(isset($staff["TaskDistribution2"])) | |
foreach($staff["TaskDistribution2"] AS $taskDistribution){ | |
$startTime = new Zend_Date(); | |
$startTime->setTime($taskDistribution["start_time"], "HH:mm:ss"); | |
$endTime = new Zend_Date(); | |
$endTime->setTime($taskDistribution["end_time"], "HH:mm:ss"); | |
if($endTime->toString('HH') == '00') | |
$endTime->setHour('24'); | |
$taskWeekTotal += $endTime->sub($startTime)->toValue()/60/60; | |
} | |
if(isset($currentDate)){ | |
$currentDate->setTime("12:00:00 AM")->toString(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment