Example usage for java.time Period toString

List of usage examples for java.time Period toString

Introduction

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

Prototype

@Override
public String toString() 

Source Link

Document

Outputs this period as a String , such as P6Y3M1D .

Usage

From source file:Main.java

public static void main(String[] args) {

    Period p = Period.ZERO;

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

}

From source file:Main.java

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

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

}

From source file:Main.java

public static void main(String[] args) {

    Period p = Period.ofDays(12);

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

}

From source file:Main.java

public static void main(String[] args) {

    Period p = Period.ofWeeks(12);

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

}

From source file:Main.java

public static void main(String[] args) {

    Period p = Period.ofYears(12);

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

}

From source file:Main.java

public static void main(String[] args) {

    Period p = Period.ofMonths(12);

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

}

From source file:Main.java

public static void main(String[] args) {

    Period p = Period.parse("P5D");

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

}

From source file:Main.java

public static void main(String[] args) {

    Period p = Period.of(2011, 12, 12);

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

}

From source file:Main.java

public static void main(String[] args) {

    Period p = Period.from(Period.ofMonths(12));

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

}