Example usage for java.time Year parse

List of usage examples for java.time Year parse

Introduction

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

Prototype

public static Year parse(CharSequence text) 

Source Link

Document

Obtains an instance of Year from a text string such as 2007 .

Usage

From source file:Main.java

public static void main(String[] args) {
    Year y = Year.parse("2014");
    System.out.println(y);

}

From source file:io.github.carlomicieli.footballdb.starter.parsers.DraftParser.java

protected Year extractYear(Document doc) {
    String title = doc.title();
    return Year.parse(title.substring(0, 4));
}