Statement: The material used in this column is written by the VIP students of the Kay Academy, who has the right to be anonymous and has the final right to interpret the article; The Edith Academy is designed to promote students to learn from each other on the basis of public notes.
System.currenttimemillis ()
This method is the actual way to get the system time.
Java.util.Date
Date class, you can convert the time type of long integer format Currenttimemillis () to our readable date format.
CompareTo () time comparison method;
Examples:
Java.util.Calendar
Calendar class
Common methods:
Getactualmaximum ();//Get the actual maximum number, depending on the parameters given to obtain the day of the year or the day of the month and so on.
Get ()//Get the thought of the date according to the parameters and so on
Add (); Add a number to the calendar, the preceding parameter is: Year/month/day/time Division/second one, after the free parameter is to add the value.
For example: How many days is it now from the Chinese New Year?
Output Result:
309 days from the New Year
SimpleDateFormat Calendar Format Class
For example:
Output Result:
February 25, 2018 18:46 07 sec Sunday pm
javase--Date Calendar class