List of usage examples for java.time LocalDate of
public static LocalDate of(int year, int month, int dayOfMonth)
From source file:Main.java
public static void main(String[] args) { LocalDate a = LocalDate.of(2014, 6, 30); LocalDateTime l = a.atStartOfDay(); System.out.println(l); }
From source file:Main.java
public static void main(String[] args) { LocalDate a = LocalDate.of(2014, 6, 30); a.adjustInto(LocalDate.of(2015, 6, 30)); }
From source file:Main.java
public static void main(String[] args) { LocalDate date = LocalDate.of(2014, 2, 15); // 2014-02-15 System.out.println(date.getYear()); // 2014 System.out.println(date.getDayOfYear()); // 46 System.out.println(date.lengthOfYear()); // 365 System.out.println(date.isLeapYear()); // false Year year_2014 = Year.of(2014); System.out.println(year_2014.isLeap()); // false }
From source file:Main.java
public static void main(String[] args) { LocalDate a = LocalDate.of(2014, 6, 30); LocalDate b = a.plus(100, ChronoUnit.DAYS); System.out.println(b);//from w ww . j a v a 2 s . co m }
From source file:Main.java
public static void main(String[] args) { LocalDate a = LocalDate.of(2014, 6, 30); LocalDate b = a.minus(6, ChronoUnit.YEARS); System.out.println(b);//from w w w .j a v a 2s .c o m }
From source file:Main.java
public static void main(String[] args) { LocalDate a = LocalDate.of(2014, 6, 30); System.out.println(a.isSupported(ChronoUnit.DAYS)); }
From source file:Main.java
public static void main(String[] args) { LocalDate a = LocalDate.of(2014, 6, 30); LocalDate b = a.with(ChronoField.YEAR, 2015); System.out.println(b);/*from w w w. jav a2 s. co m*/ }
From source file:Main.java
public static void main(String[] args) { LocalDate date = LocalDate.of(2014, 2, 15); // 2014-06-15 DayOfWeek dayOfWeek = date.getDayOfWeek(); int dayOfWeekIntValue = dayOfWeek.getValue(); // 6 String dayOfWeekName = dayOfWeek.name(); // SATURDAY System.out.println(dayOfWeekIntValue); System.out.println(dayOfWeekName); }
From source file:Main.java
public static void main(String[] args) { LocalDate a = LocalDate.of(2014, 6, 30); System.out.println(a.range(ChronoField.DAY_OF_YEAR)); }
From source file:Main.java
public static void main(String[] args) { LocalDate a = LocalDate.of(2014, 6, 30); System.out.println(a.getLong(ChronoField.DAY_OF_YEAR)); }