Date N/A YYYY-MM-DD LocalDateTime Date/Time N/A YYYY-MM-DDThh:mm:ss LocalTime Time N/A hh:mm:ss OffsetDateTime Date/Time offset YYYY-MM-DDThh:mm:ss±hh:mm OffsetTime Time offset hh:mm:ss±hh:mm ZonedDateTime Date/Time zone id N/A
7, 11) now Create from a clock. e.g. LocalDate.now() from Create from other Temporal objects. e.g. LocalDate.from(LocalDateTime.now()) parse Create from String. (may use a formatter) e.g. LocalDate.parse("2015-07-11")
field. e.g. LocalDate.now().getYear() e.g. LocalDate.now().get(YEAR) with- Modify the value of a field (returns a copy). e.g. LocalDate.now().withYear(2016) e.g. LocalDate.now().with(2016, YEAR)
a copy) e.g. LocalDate.now().plusDays(7) e.g. LocalDate.now().plus(7, DAYS) minus- subtract a field value. (returns a copy) e.g. LocalDate.now().minusDays(7) e.g. LocalDate.now().minus(7, DAYS)
today.isBefore(today) ; false e.g. today.isBefore(tomorrow) ; true isEqual e.g. today.isEqual(yesterday) ; false e.g. today.isEqual(today) ; true e.g. today.isEqual(tomorrow) ; false isAfter e.g. today.isAfter(yesterday) ; true e.g. today.isAfter(today) ; false e.g. today.isAfter(tomorrow) ; false
"period" (ISO 8601). • Period is the date part of "period", i.e. formatted as "P1Y2M3D" • Duration is the time part of "period", i.e. formatted as "PT15H30M45D"
fixed offsets. • Contains the offset from UTC. • Used for OffsetDateTime/OffsetTime. • Used for ZonedDateTime (as ZoneId). • Defines transitions of ZoneRules.
but ZonedDateTime is not. • ZonedDateTime is adapt to daylight savings easily. OffsetDateTime is not. • Zones may be changed because of region or country convenience. But offsets are never.
some local chronology; Japanese Era, Minguo Era, Thai Buddhist Era and Hijrah Era • User defined chronologies are also supported -> Chronology Framework
chronology • ChronoLocalDateTime<D> / ChronoZonedDateTime<D> instead of LocalDateTime / ZonedDateTime • different chronology can convert by from method each other