Showing posts with label Date Time API. Show all posts
Showing posts with label Date Time API. Show all posts

Thursday, August 15, 2019

Java 8 MinguoDate API Examples

1. Overview


In this tutorial, We'll be learning MinguoDate introduced in Java 8. The MinguoDate class is immutable and thread-safe. So, it can be used in multithreaded applications without explicit synchronization.

This date operates using the Minguo calendar. This calendar system is primarily used in the Republic of China, often known as Taiwan. Dates are aligned such that 0001-01-01 (Minguo) is 1912-01-01 (ISO).

Below is the class MinguoDate internal declaration in API source code.

public final class MinguoDate
extends Object
implements ChronoLocalDate, Serializable


Now, We'll see the example programs to convert localdate to MinguoDate and from MinguoDate to local date.

Friday, August 9, 2019

Java 8 – TemporalAdjusters examples

1. Overview


In this tutorial, We'll learn about the new Java 8 TemporalAdjusters class and its methods along with examples.

This is part of the new java 8 date and time API and in java.time.temporal package and class name TemporalAdjusters. This class now has predefined temporal objects to change the data as we want.

TemporalAdjusters class is a collection of TemporalAdjuster implementations.

First We will see the example programs on the TemporalAdjusters class and next take a look at the Temporal interface.

At last, We'll define custom TemporalAdjuster implementation.