Example usage for java.time.temporal ChronoField HOUR_OF_AMPM

List of usage examples for java.time.temporal ChronoField HOUR_OF_AMPM

Introduction

In this page you can find the example usage for java.time.temporal ChronoField HOUR_OF_AMPM.

Prototype

ChronoField HOUR_OF_AMPM

To view the source code for java.time.temporal ChronoField HOUR_OF_AMPM.

Click Source Link

Document

The hour-of-am-pm.

Usage

From source file:Main.java

public static void main(String[] args) {
    LocalDateTime now = LocalDateTime.now();
    System.out.println(now.get(ChronoField.YEAR));
    System.out.println(now.get(ChronoField.MONTH_OF_YEAR));
    System.out.println(now.get(ChronoField.DAY_OF_MONTH));
    System.out.println(now.get(ChronoField.HOUR_OF_DAY));
    System.out.println(now.get(ChronoField.HOUR_OF_AMPM));
    System.out.println(now.get(ChronoField.AMPM_OF_DAY));

}