Example usage for java.time ZonedDateTime getMonth

List of usage examples for java.time ZonedDateTime getMonth

Introduction

In this page you can find the example usage for java.time ZonedDateTime getMonth.

Prototype

public Month getMonth() 

Source Link

Document

Gets the month-of-year field using the Month enum.

Usage

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.now();

    System.out.println(dateTime.getMonth());
}

From source file:onl.area51.httpd.action.Request.java

default Request addHeader(String n, ZonedDateTime zdt) {
    return addHeader(n,
            String.format("%3s, %02d %3s %d %02d:%02d:%02d GMT",
                    zdt.getDayOfWeek().getDisplayName(TextStyle.SHORT, Locale.ENGLISH), zdt.getDayOfMonth(),
                    zdt.getMonth().getDisplayName(TextStyle.SHORT, Locale.ENGLISH), zdt.getYear(),
                    zdt.getHour(), zdt.getMinute(), zdt.getSecond()));
}