Example usage for java.time LocalDate of

List of usage examples for java.time LocalDate of

Introduction

In this page you can find the example usage for java.time LocalDate of.

Prototype

public static LocalDate of(int year, int month, int dayOfMonth) 

Source Link

Document

Obtains an instance of LocalDate from a year, month and day.

Usage

From source file:Main.java

public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);
    LocalDate b = a.withYear(2015);
    System.out.println(b);
}

From source file:Main.java

public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);
    LocalDate b = a.plusWeeks(100);
    System.out.println(b);
}

From source file:Main.java

public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);

    System.out.println(a.getEra().getValue());
}

From source file:Main.java

public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);

    System.out.println(a.getYear());
}

From source file:Main.java

public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);
    LocalDate b = LocalDate.of(2014, 7, 1);
    System.out.println(a.isEqual(b));
    System.out.println(a.isEqual(a));
    System.out.println(b.isEqual(a));
}

From source file:Main.java

public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);
    LocalDate b = LocalDate.of(2014, 7, 1);
    System.out.println(a.isBefore(b));
    System.out.println(a.isBefore(a));
    System.out.println(b.isBefore(a));
}

From source file:Main.java

public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);
    LocalDate b = LocalDate.of(2014, 7, 1);
    System.out.println(a.compareTo(b));
    System.out.println(a.compareTo(a));
    System.out.println(b.compareTo(a));
}

From source file:Main.java

public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);
    LocalDate b = LocalDate.of(2014, 7, 1);
    System.out.println(a.toEpochDay());
    System.out.println(b.toEpochDay());

}

From source file:Main.java

public static void main(String[] argv) {
    LocalDate dateOfBirth = LocalDate.of(2010, 1, 14);
    System.out.println("Your Date of birth is : " + dateOfBirth);

}

From source file:Main.java

public static void main(String[] args) {
    LocalDate localDate = LocalDate.of(2014, 6, 21);
    LocalDate localDate1 = localDate.plusDays(5);
    System.out.println(localDate1);
    LocalDate localDate2 = localDate.plusMonths(3);
    System.out.println(localDate2);
    LocalDate localDate3 = localDate.plusWeeks(3);
    System.out.println(localDate3);
}