1. Date class
Common method: Long gettime (): returns the millisecond value since 00:00:00, January 1, January 1, 1970, and converts a date object to a millisecond value.
2. dateformat class
The date format class is an abstract class of the date/time format subclass. format and parse the date and time in a language-independent manner. The date formatting subclass datesimpleformat allows formatting (date-> text) and parsing (text-> date ).
Common method of dateformat class:
- String string format (date): format a date object as a date/time string
- Date parse (string STR Str): parses a specified string to ask a date/time object.
3. Calendar class
Common methods in the calendar class:
- Abstract void add (INT field, int amount): add or subtract the specified time amount for the specified calendar field according to calendar rules.
- Int get (INT field): returns the value of the given calendar field.
- Static calendar getinstance (): obtains a calendar using the default time zone and language environment.
- Date gettime (): returns a date object that represents the time value of this calendar.
- Void set (INT field, int value): sets the specified calendar field to the specified value.
Date, dateformat, and calendar