JAVA8 Relationship before date time

Source: Internet
Author: User
Tags time zones time and date

Year Day
Class or Enum Month 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.