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 ...

Get PURE Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.