Example usage for java.time LocalDate now

List of usage examples for java.time LocalDate now

Introduction

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

Prototype

public static LocalDate now() 

Source Link

Document

Obtains the current date from the system clock in the default time-zone.

Usage

From source file:Main.java

public static void main(String[] args) {
    Year y = Year.from(LocalDate.now());
    System.out.println(y);

}

From source file:Main.java

public static void main(String[] args) {
    // Human Readable
    LocalDate date = LocalDate.now();
    System.out.println(String.format("%s-%s-%s", date.getYear(), date.getMonthValue(), date.getDayOfMonth()));

}

From source file:Main.java

public static void main(String[] args) {
    Month m = Month.from(LocalDate.now());

    System.out.println(m.minLength());

}

From source file:Main.java

public static void main(String[] args) {
    Month m = Month.from(LocalDate.now());

    System.out.println(m.firstDayOfYear(false));

}

From source file:Main.java

public static void main(String[] args) {
    Month m = Month.from(LocalDate.now());
    System.out.println(m.getValue());
    System.out.println(m.name());
    System.out.println(m.ordinal());
}

From source file:Main.java

public static void main(String[] args) {
    Month m = Month.from(LocalDate.now());

    System.out.println(m.firstMonthOfQuarter());

}

From source file:Main.java

public static void main(String[] args) {
    Month m = Month.from(LocalDate.now());

    System.out.println(m.plus(8));

}

From source file:Main.java

public static void main(String[] args) {
    Month m = Month.from(LocalDate.now());

    System.out.println(m.length(true));

}

From source file:Main.java

public static void main(String[] args) {
    Month m = Month.from(LocalDate.now());

    System.out.println(m.maxLength());

}

From source file:Main.java

public static void main(String[] args) {
    Month m = Month.from(LocalDate.now());

    System.out.println(m.minus(8));

}