GregorianCalendar
In JDK 1.0, the Date class, which is a measure of the number of milliseconds that have passed since the start of the current era, was used for calendar-type dates. You would create a Date object and set its day, month, year, and time as needed. The Date class, however, lacked several important properties, such as support for daylight savings time and time zones. In response to these gaps, Javasoft introduced the Calendar and GregorianCalendar classes in JDK 1.1. Beginning with JDK 1.1 and now in Java 2, the java.util.Date class is intended to be used for a "moment in time." That is, if you need to compare two time values or subtract an earlier time from a later time, to find out how long something took to happen, the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access