DateTimeFormatter In Java 8

The new Date API proposes a new formatter DateTimeFormatter. The DateTimeFormatter proposes a set of predefined formatters, available as constants. Formatting a date little bit complex as there are many norms and many ways to do this. Usually an application has own norms and own ways to format a date. There are certain predefined constant formatter available directly from DateTimeFormatter class.

Let’s us take our previous example our nextMeetingUS  object of ZonedDateTime class, we can format it with predefined formatter like ISO_DATE_TIME and RFC_1123_DATE_TIME

Leave a Reply

Your email address will not be published. Required fields are marked *