Overview of Java Time API classes (java.time)
The Java Time API provides a set of classes for handling dates, times, durations, and time zones. Key classes include:
Clock: Accesses the current date and time for a specific time zone.DayOfWeek: Enum representing the seven days of the week.Duration: Represents a time amount (hours, minutes, seconds).Instant: A specific moment in time, precise to nanoseconds. Supportsnow(),plusXxx(), andminusXxx()methods.LocalDate: A date without a time zone (e.g., 2018-01-27). Supportsnow(),plusXxx(), andminusXxx().LocalTime: A time without a date or time zone (e.g., 14:49:20). Supportsnow(),plusXxx(), andminusXxx().LocalDateTime: A combined date and time without a time zone. Supportsnow(),plusXxx(), andminusXxx().Month: Enum representing the twelve months of the year.MonthDay: A month-of-year and day-of-month (e.g., 01-27).Year: Represents a year (e.g., 2018). Supportsnow(),plusYears(), andminusYears().YearMonth: A combination of year and month (e.g., 2018-01).ZoneId: An identifier for a time zone.ZonedDateTime: A date-time with a time zone.