Class or Enum |
| Year
Month |
| Day
Hours |
Minutes |
seconds* |
Zone Offset |
Zone ID |
toString Output |
Where discussed |
Instant |
|
|
|
|
|
|
|
|
2013-08-20t15:16:26.355z |
Instant Class |
Localdate |
|
|
|
|
|
|
|
|
2013-08-20 |
Date Classes |
LocalDateTime |
|
|
|
|
|
|
|
|
2013-08-20t08:16:26.937 |
Date and Time Classes |
Zoneddatetime |
|
|
|
|
|
|
|
|
2013-08-21t00:16:26.941+09:00[asia/tokyo] |
Time Zone and Offset Classes |
LocalTime |
|
|
|
|
|
|
|
|
08:16:26.943 |
Date and Time Classes |
MonthDay |
|
|
|
|
|
|
|
|
--08-20 |
Date Classes |
Year |
|
|
|
|
|
|
|
|
2013 |
Date Classes |
Yearmonth |
|
|
|
|
|
|
|
|
2013-08 |
Date Classes |
Month |
|
|
|
|
|
|
|
|
August |
DayOfWeek and Month Enums |
Offsetdatetime |
|
|
|
|
|
|
|
|
2013-08-20t08:16:26.954-07:00 |
Time Zone and Offset Classes |
Offsettime |
|
|
|
|
|
|
|
|
08:16:26.957-07:00 |
Time Zone and Offset Classes |
Duration |
|
|
** |
** |
** |
|
|
|
pt20h (hours) |
Period and Duration |
Period |
|
|
|
|
|
|
*** |
*** |
p10d (Ten days) |
Period and Duration |
Java.time The core package for the date and time API. It includes a combination of date, time, date and time, time zone, instantaneous, duration, and clock. These classes are based on the defined ISO-8601 calendar system, which is immutable and thread-safe. Java.time.chrono provides access to different calendar systems. You can customize your own calendar system. Java.time.format format and parse time and date. The Java.time.temporal Extension API provides the underlying framework and extension features that allow interoperability between date and time classes, such as querying (querying) and Tuning (adjustment) (using the fields defined in the package ( Temporalfield and Chronofield) and units (Temporalunit and Chronounit)). Java.time.zone supports the time zone, the class from the time zone offset, and the time zone rule. If you want to use time zones, most developers only need to use zoneddatetime, and ZoneID or Zoneoffset.
Common method Prefixes:
- Of: Static factory method, creating instances from components
- From: Static Factory method, which attempts to extract an instance from a similar object. The From () method does not have the type of () method safe
- Now: Static Factory method, creating an instance with the current time
- Parse: Static Factory method, total string parsing to get object instance
- Get: Gets the partial state of the time Date object
- is: Check that the description of the time Date object is correct
- With: Returns a copy of the time-date object with a partial state change.
- Plus: Returns a time-of-day, time-Date object copy
- Minus: Returns a time-reduced, time-Date object copy
- To: Converts the current time-date object to another, possibly losing some state
- At: Combining the current time date object with another, creating a larger or more complex time-date object
- Format: provides the ability to format time-date objects
JAVA8 Relationship before date time