/** * Returns a copy of this LocalDateTime with the month-of-year altered. * * If the day-of-month is invalid for the month and year, it will be changed to the last valid day of the month. * * @param integer $month * * @return LocalDateTime * * @throws DateTimeException If the month is invalid. */ public function withMonth($month) { return $this->with($this->date->withMonth($month), $this->time); }