Example usage for java.time YearMonth now

List of usage examples for java.time YearMonth now

Introduction

In this page you can find the example usage for java.time YearMonth now.

Prototype

public static YearMonth now(Clock clock) 

Source Link

Document

Obtains the current year-month from the specified clock.

Usage

From source file:Main.java

public static void main(String[] args) {
    YearMonth y = YearMonth.now(Clock.systemUTC());

    System.out.println(y);

}

From source file:Main.java

public static void main(String[] args) {
    YearMonth y = YearMonth.now(ZoneId.systemDefault());

    System.out.println(y);

}