예제 #1
0
 /**
  * Returns a copy of this {@code LocalDateTime} with the minute-of-hour altered.
  * <p>
  * This instance is immutable and unaffected by this method call.
  *
  * @param int $minute the minute-of-hour to set in the result, from 0 to 59
  * @return LocalDateTime a {@code LocalDateTime} based on this date-time with the requested minute, not null
  * @throws DateTimeException if the minute value is invalid
  */
 public function withMinute($minute)
 {
     $newTime = $this->time->withMinute($minute);
     return $this->_with($this->date, $newTime);
 }
예제 #2
0
 /**
  * Returns a copy of this {@code OffsetTime} with the minute-of-hour altered.
  * <p>
  * The offset does not affect the calculation and will be the same in the result.
  * <p>
  * This instance is immutable and unaffected by this method call.
  *
  * @param int $minute the minute-of-hour to set in the result, from 0 to 59
  * @return OffsetTime an {@code OffsetTime} based on this time with the requested minute, not null
  * @throws DateTimeException if the minute value is invalid
  */
 public function withMinute($minute)
 {
     return $this->_with($this->time->withMinute($minute), $this->offset);
 }