public function calcDurationBasedOnEndDateTime($end)
    {
        $startDate = strtotime($this->StartDateTime);
        $endDate = strtotime($end);

        $duration = $endDate - $startDate;
        $secsInDay = 60 * 60 * 24;
        if ($duration > $secsInDay) {
            //Duration cannot be more than 24h
            return false;
        }

        //info on this calculation here:
        //http://stackoverflow.com/questions/3856293/how-to-convert-seconds-to-time-format
        $formatDate = gmdate("H:i", $duration);

        return $formatDate;
    }
public function calcDurationBasedOnEndDateTime($end)
    {
        $startDate = strtotime($this->StartDateTime);
        $endDate = strtotime($end);

        $duration = $endDate - $startDate;
        $secsInDay = 60 * 60 * 24;
        if ($duration > $secsInDay) {
            //Duration cannot be more than 24h
            return false;
        }

        //info on this calculation here:
        //http://stackoverflow.com/questions/3856293/how-to-convert-seconds-to-time-format
        $formatDate = gmdate("H:i", $duration);

        return $formatDate;
    }
public function calcDurationBasedOnEndDateTime ( $ end ) { $ startDate = strtotime ( $ this -> StartDateTime ) ; $ endDate = strtotime ( $ end ) ; $ duration = $ endDate - $ startDate ; $ secsInDay = 60 * 60 * 24 ; if ( $ duration > $ secsInDay ) { //Duration cannot be more than 24h return false ; } //info on this calculation here: //http://stackoverflow.com/questions/3856293/how-to-convert-seconds-to-time-format $ formatDate = gmdate ( "H:i" , $ duration ) ; return $ formatDate ; }
Calculation of duration based on end datetime
Returns false if there's more than 24h between start and end date
@return string|false
Calculation of duration based on end datetime Returns false if there s more than 24h between start and end date