Example usage for java.time Period ofMonths

List of usage examples for java.time Period ofMonths

Introduction

In this page you can find the example usage for java.time Period ofMonths.

Prototype

public static Period ofMonths(int months) 

Source Link

Document

Obtains a Period representing a number of months.

Usage

From source file:Main.java

public static void main(String[] args) {
    Period p = Period.ofMonths(1);

    System.out.println(p.isZero());

}

From source file:Main.java

public static void main(String[] args) {
    Period p = Period.ofMonths(1);

    System.out.println(p.isNegative());

}

From source file:Main.java

public static void main(String[] args) {
    Period p = Period.ofMonths(1);

    System.out.println(p.getYears());

}

From source file:Main.java

public static void main(String[] args) {
    Period p = Period.ofMonths(1);

    System.out.println(p.getChronology());

}

From source file:Main.java

public static void main(String[] args) {
    Period p = Period.ofMonths(1);

    System.out.println(p.getMonths());

}

From source file:Main.java

public static void main(String[] args) {
    Period p = Period.ofMonths(1);

    System.out.println(p.getDays());

}

From source file:Main.java

public static void main(String[] args) {
    Period p = Period.ofMonths(1);

    System.out.println(p.getUnits());

}

From source file:Main.java

public static void main(String[] args) {
    Period p = Period.ofMonths(1);

    Period l = p.minusYears(10);
    System.out.println(l);

}

From source file:Main.java

public static void main(String[] args) {
    Period p = Period.ofMonths(1);

    long l = p.toTotalMonths();
    System.out.println(l);

}

From source file:Main.java

public static void main(String[] args) {
    Period p = Period.ofMonths(123);

    Period l = p.normalized();
    System.out.println(l);

}