Ejemplo n.º 1
0
 /**
  * Gets the day-of-year field.
  * <p>
  * This method returns the primitive {@code int} value for the day-of-year.
  *
  * @return int the day-of-year, from 1 to 365, or 366 in a leap year
  */
 public function getDayOfYear()
 {
     return $this->dateTime->getDayOfYear();
 }
 public function setFieldsDateTime(LocalDateTime $dt)
 {
     if ($dt !== null) {
         $this->fields->put(ChronoField::YEAR(), $dt->getYear());
         $this->fields->put(ChronoField::MONTH_OF_YEAR(), $dt->getMonthValue());
         $this->fields->put(ChronoField::DAY_OF_MONTH(), $dt->getDayOfMonth());
         $this->fields->put(ChronoField::DAY_OF_YEAR(), $dt->getDayOfYear());
         $this->fields->put(ChronoField::DAY_OF_WEEK(), $dt->getDayOfWeek()->getValue());
         $this->fields->put(IsoFields::WEEK_BASED_YEAR(), $dt->getLong(IsoFields::WEEK_BASED_YEAR()));
         $this->fields->put(IsoFields::WEEK_OF_WEEK_BASED_YEAR(), $dt->getLong(IsoFields::WEEK_OF_WEEK_BASED_YEAR()));
         $this->fields->put(ChronoField::HOUR_OF_DAY(), $dt->getHour());
         $this->fields->put(ChronoField::MINUTE_OF_HOUR(), $dt->getMinute());
         $this->fields->put(ChronoField::SECOND_OF_MINUTE(), $dt->getSecond());
         $this->fields->put(ChronoField::NANO_OF_SECOND(), $dt->getNano());
     }
 }