Humans deal with time in terms of fields such as year, month, day, hour, minute, and second.
The following format is used to specify date and time in ISO-8601 format:
[date]T[time][zone offset]
The Date-Time API provides several classes listed in the following table to represent all fields and their combinations of human-scale time.
Class Name | Date | Time | Zone Offset | Zone Rule |
---|---|---|---|---|
LocalDate | Yes | No | No | No |
LocalTime | No | Yes | No | No |
LocalDateTime | Yes | Yes | No | No |
OffsetTime | No | Yes | Yes | No |
OffsetDateTime | Yes | Yes | Yes | No |
ZonedDateTime | Yes | Yes | Yes | Yes |
ZoneOffset | No | No | Yes | No |
ZoneId | No | No | Yes | Yes |