Example usage for java.time Month from

List of usage examples for java.time Month from

Introduction

In this page you can find the example usage for java.time Month from.

Prototype

public static Month from(TemporalAccessor temporal) 

Source Link

Document

Obtains an instance of Month from a temporal object.

Usage

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));

}

From source file:Main.java

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

    Temporal n = m.adjustInto(LocalDate.now());
    System.out.println(n);/*  ww  w  . ja  v  a  2 s . co m*/

}

From source file:Main.java

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

    System.out.println(m.get(ChronoField.MONTH_OF_YEAR));

}