Prior to JSR-310, it was not straightforward to create date and time instances for any point in time or any day in a calendar. The only way was to use the java.util.Calendar object to set the required dates and time, and then invoke the getTime() method to get an instance of java.util.Date. And those date and time instances contained time zone information as well, which sometimes led to bugs in the application.
In new APIs, it's far simpler to get date and time instances, and these date and time instances do not have any time zone information associated with them. In this recipe, we will show you how to work with date-only instances represented by java.time.LocalDate, time-only instances represented by java.time.LocalTime, and date/time instances represented by java.time.LocalDateTime. These date and time instances...