Example usage for java.time.temporal ChronoField AMPM_OF_DAY

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

Introduction

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

Prototype

ChronoField AMPM_OF_DAY

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

Click Source Link

Document

The am-pm-of-day.

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));

}