Example usage for java.time Period toTotalMonths

List of usage examples for java.time Period toTotalMonths

Introduction

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

Prototype

public long toTotalMonths() 

Source Link

Document

Gets the total number of months in this period.

Usage

From source file:Main.java

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

    long l = p.toTotalMonths();
    System.out.println(l);/*  w  w  w. j  ava2s . c o m*/

}