The diagrams of Java Calendar,date,timezone,locale and DateFormat are as follows:
Description
The milliseconds represents milliseconds.
milliseconds = "actual Time"-"1970-01-01 00:00:00". Calendar and date depend on milliseconds, which represents time.
The calendar represents the date/time.
It is an abstract class that relies on milliseconds. GregorianCalendar is a subclass of the calendar, and usually when we get a calendar instance through Calendar.getinstance (), we actually return the GregorianCalendar object. Calendar and locale are associated, while locale represents the region, the locale value is not the same, and the calendar date/time is different. Calendar and timezone are associated, while timezone represents the time zone, different time zones, and calendar dates/times are also different.
Date represents the day/time.
It also relies on milliseconds implementations. Before JDK 1.1, the date operation was usually "day and minute". However, because the relevant API for date is not easy to internationalize. Starting with JDK 1.1, you should use the Calendar class to manipulate "month and day seconds and minutes", and to format and parse date strings through the DateFormat class. The appropriate method in date has been deprecated.
DateFormat is a tool class that formats/parses the date/time.
It is the format tool for date, which helps us format date and then converts the date into the string string we want for our use. It is an abstract class. Typically, when we get DateFormat instances through getinstance (), Getdateinstance (), and getdatetimeinstance (), we actually return the SimpleDateFormat object.
Java Time schema diagram