Year atDay(int dayOfYear) example

Description

Year atDay(int dayOfYear) combines this year with a day-of-year to create a LocalDate.

Syntax

atDay has the following syntax.


public LocalDate atDay(int dayOfYear)

Example

The following example shows how to use atDay.


import java.time.LocalDate;
import java.time.Year;
/* ww  w.  j av  a 2 s .  c o m*/
public class Main {
  public static void main(String[] args) {
    Year y = Year.of(2014);
    LocalDate l = y.atDay(123);
    System.out.println(l);

  }
}

The code above generates the following result.





















Home »
  Java Date Time »
    java.time Reference »




Clock
DayOfWeek
Duration
Instant
LocalDate
LocalDateTime
LocalTime
Month
MonthDay
OffsetDateTime
OffsetTime
Period
Year
YearMonth
ZonedDateTime
ZoneId
ZoneOffset