1 | import java.util.Calendar; |
注意:Calendar和Date类都有getTime()方法,但意义不同,
1.Object Calendar.getTime():Returns a Date object representing this Calendar’s time value (millisecond offset from the Epoch”).
2.Date Date.getTime():Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.