Пример #1
0
 /**
  * Returns a copy of this LocalDateTime with the year altered.
  *
  * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.
  *
  * @param integer $year
  *
  * @return LocalDateTime
  *
  * @throws DateTimeException If the year is outside the valid range.
  */
 public function withYear($year)
 {
     return $this->with($this->date->withYear($year), $this->time);
 }