src/util/Date.php
public static function addDays($date, $days) {
        if (Validator::isDateTime($date) === false) throw new InvalidArgumentException('Invalid argument $date: '.$date);
        if (!is_int($days))                         throw new IllegalTypeException('Illegal type of parameter $days: '.gettype($days));

        $parts = explode('-', $date);
        $year  = (int) $parts[0];
        $month = (int) $parts[1];
        $day   = (int) $parts[2];

        return date('Y-m-d', mktime(0, 0, 0, $month, $day+$days, $year));
    }
public static function addDays($date, $days) {
        if (Validator::isDateTime($date) === false) throw new InvalidArgumentException('Invalid argument $date: '.$date);
        if (!is_int($days))                         throw new IllegalTypeException('Illegal type of parameter $days: '.gettype($days));

        $parts = explode('-', $date);
        $year  = (int) $parts[0];
        $month = (int) $parts[1];
        $day   = (int) $parts[2];

        return date('Y-m-d', mktime(0, 0, 0, $month, $day+$days, $year));
    }
public static function addDays ( $ date , $ days ) { if ( Validator :: isDateTime ( $ date ) === false ) throw new InvalidArgumentException ( 'Invalid argument $date: ' . $ date ) ; if ( ! is_int ( $ days ) ) throw new IllegalTypeException ( 'Illegal type of parameter $days: ' . gettype ( $ days ) ) ; $ parts = explode ( '-' , $ date ) ; $ year = ( int ) $ parts [ 0 ] ; $ month = ( int ) $ parts [ 1 ] ; $ day = ( int ) $ parts [ 2 ] ; return date ( 'Y-m-d' , mktime ( 0 , 0 , 0 , $ month , $ day + $ days , $ year ) ) ; }
Add a number of days to a date.

@param  string $date - initial date (format: yyyy-mm-dd)
@param  int    $days - number of days to add

@return string - reslting date
Add a number of days to a date .