Package org.apache.commons.lang3.time
Class CalendarUtils
- java.lang.Object
 - 
- org.apache.commons.lang3.time.CalendarUtils
 
 
- 
public class CalendarUtils extends java.lang.ObjectHelps useCalendars.- Since:
 - 3.10
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static CalendarUtilsINSTANCEThe singleton instance forCalendar.getInstance(). 
- 
Constructor Summary
Constructors Constructor Description CalendarUtils(java.util.Calendar calendar)Creates an instance for the given Calendar. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDayOfMonth()Gets the current day of month.intgetDayOfYear()Gets the current day of year.static CalendarUtilsgetInstance()Creates a new instance based on the current time in the default time zone with the defaultLocale.Category.FORMATlocale.intgetMonth()Gets the current month.intgetYear()Gets the current year. 
 - 
 
- 
- 
Field Detail
- 
INSTANCE
public static final CalendarUtils INSTANCE
The singleton instance forCalendar.getInstance(). The instance is created when the class is initialized and is based on the current time in the default time zone with the defaultLocale.Category.FORMATlocale.- See Also:
 getInstance()
 
 - 
 
- 
Method Detail
- 
getInstance
public static CalendarUtils getInstance()
Creates a new instance based on the current time in the default time zone with the defaultLocale.Category.FORMATlocale.- Returns:
 - a new instance.
 - Since:
 - 3.14.0
 
 
- 
getDayOfMonth
public int getDayOfMonth()
Gets the current day of month.- Returns:
 - the current day of month.
 
 
- 
getDayOfYear
public int getDayOfYear()
Gets the current day of year.- Returns:
 - the current day of year.
 - Since:
 - 3.13.0
 
 
- 
getMonth
public int getMonth()
Gets the current month.- Returns:
 - the current month.
 
 
- 
getYear
public int getYear()
Gets the current year.- Returns:
 - the current year.
 
 
 - 
 
 -