Example usage for java.time Year format

List of usage examples for java.time Year format

Introduction

In this page you can find the example usage for java.time Year format.

Prototype

public String format(DateTimeFormatter formatter) 

Source Link

Document

Formats this year using the specified formatter.

Usage

From source file:Main.java

public static void main(String[] args) {
    Year y = Year.of(2014);
    String l = y.format(DateTimeFormatter.ofPattern("yyyy"));
    System.out.println(l);//from   w w w. ja va  2s .co  m

}