function plusDays($days)
 {
     return $this->withDate($this->isoDate->plusDays($days));
 }
示例#2
0
 /**
  * Returns a copy of this {@code LocalDateTime} with the specified number of days added.
  * <p>
  * This method adds the specified amount to the days field incrementing the
  * month and year fields as necessary to ensure the result remains valid.
  * The result is only invalid if the maximum/minimum year is exceeded.
  * <p>
  * For example, 2008-12-31 plus one day would result in 2009-01-01.
  * <p>
  * This instance is immutable and unaffected by this method call.
  *
  * @param int $days the days to add, may be negative
  * @return LocalDateTime a {@code LocalDateTime} based on this date-time with the days added, not null
  * @throws DateTimeException if the result exceeds the supported date range
  */
 public function plusDays($days)
 {
     $newDate = $this->date->plusDays($days);
     return $this->_with($newDate, $this->time);
 }