Class of the Month: GregorianCalendar

Subclasses of Calendar interpret a date according to the rules of a specific calendar system. One such subclass is java.util.GregorianCalendar. You can use the methods and properties of GregorianCalendar for many of your date and time calculations and comparisons.

provided by: 
Originally published at Internet.com


Business applications often require date and time calculations. Furthermore, in a global environment, these calculations must be localized for various geographical regions in which the application is running. The Java platform took a huge step in streamlining the way it deals with date and time by introducing the abstract java.util.Calendar class. Subclasses of Calendar interpret a date according to the rules of a specific calendar system. One such subclass is java.util.GregorianCalendar. You can use the methods and properties of GregorianCalendar for many of your date and time calculations and comparisons.

Piroz Mohseni

You have a few choices with the constructor. If you are happy with the default time zone and default locale object, then you can use the null constructor (no arguments) or one of the constructors that allows you to specify the year, month, date, hour, and minutes. For applications that could potentially be used in different regions, you probably want to be more specific about the Locale and TimeZone objects. There are constructors that allow you to specify a Locale, a TimeZone, or both to create the GregorianCalendar object. If you are going to use TimeZone, take a look at java.util.SimpleTimeZone, which is a concrete subclass of TimeZone. " The GreogorianCalendar class offers most of the information and calculations a typical date-based application needs." ...

Read article at Internet.com site
Regional Articles
- Class of the Month: GregorianCalendar Alabama
- Class of the Month: GregorianCalendar Alaska
- Class of the Month: GregorianCalendar Arizona
- Class of the Month: GregorianCalendar Arkansas
- Class of the Month: GregorianCalendar California
- Class of the Month: GregorianCalendar Colorado
- Class of the Month: GregorianCalendar Connecticut
- Class of the Month: GregorianCalendar DC
- Class of the Month: GregorianCalendar Delaware
- Class of the Month: GregorianCalendar Florida
- Class of the Month: GregorianCalendar Georgia
- Class of the Month: GregorianCalendar Hawaii
- Class of the Month: GregorianCalendar Idaho
- Class of the Month: GregorianCalendar Illinois
- Class of the Month: GregorianCalendar Indiana
- Class of the Month: GregorianCalendar Iowa
- Class of the Month: GregorianCalendar Kansas
- Class of the Month: GregorianCalendar Kentucky
- Class of the Month: GregorianCalendar Louisiana
- Class of the Month: GregorianCalendar Maine
- Class of the Month: GregorianCalendar Maryland
- Class of the Month: GregorianCalendar Massachusetts
- Class of the Month: GregorianCalendar Michigan
- Class of the Month: GregorianCalendar Minnesota
- Class of the Month: GregorianCalendar Mississippi
- Class of the Month: GregorianCalendar Missouri
- Class of the Month: GregorianCalendar Montana
- Class of the Month: GregorianCalendar Nebraska
- Class of the Month: GregorianCalendar Nevada
- Class of the Month: GregorianCalendar New Hampshire
- Class of the Month: GregorianCalendar New Jersey
- Class of the Month: GregorianCalendar New Mexico
- Class of the Month: GregorianCalendar New York
- Class of the Month: GregorianCalendar North Carolina
- Class of the Month: GregorianCalendar North Dakota
- Class of the Month: GregorianCalendar Ohio
- Class of the Month: GregorianCalendar Oklahoma
- Class of the Month: GregorianCalendar Oregon
- Class of the Month: GregorianCalendar Pennsylvania
- Class of the Month: GregorianCalendar Rhode Island
- Class of the Month: GregorianCalendar South Carolina
- Class of the Month: GregorianCalendar South Dakota
- Class of the Month: GregorianCalendar Tennessee
- Class of the Month: GregorianCalendar Texas
- Class of the Month: GregorianCalendar Utah
- Class of the Month: GregorianCalendar Vermont
- Class of the Month: GregorianCalendar Virginia
- Class of the Month: GregorianCalendar Washington
- Class of the Month: GregorianCalendar West Virginia
- Class of the Month: GregorianCalendar Wisconsin
- Class of the Month: GregorianCalendar Wyoming

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML