Convert int to date in java
There is no direct correspondence between the Date class and other data types, but the year, month, day, hour, minute and second can be represented by the int type respectively, thus establishing the correspondence between them. During this transformation, three forms of Date class constructors can be used: Date (int year, int month, int date): using int type to represent year, month, day (int month, int date, int hrs, int min): representing year, month, day, hour, minute and day (int year, Int month, int date, int hrs, int min, Int sec): Year, month, day, hour, minute and second are expressed in the form of int. \r There is an interesting correspondence between long integers and Date classes, that is, a time is expressed as milliseconds from 0: 00: 00 GMT19701December1. For this correspondence, the Date class also has its corresponding constructor: Date(long Date) gets the year, month, day, hour, minute, second and week in the Date class. You can use the date classes getYear (), getMonth (), getDate (), getHours (), getMinutes (), getSeconds () and getDay.