Java Date Time - LocalDate ofYearDay(int year, int dayOfYear) example








LocalDate ofYearDay(int year, int dayOfYear) creates an instance of LocalDate from a year and day-of-year.

Syntax

ofYearDay has the following syntax.

public static LocalDate ofYearDay(int year,   int dayOfYear)

Example

The following example shows how to use ofYearDay.

import java.time.LocalDate;

public class Main {
  public static void main(String[] args) {
    LocalDate a = LocalDate.ofYearDay(2014,10);
    
    System.out.println(a);
  }
}

The code above generates the following result.