Class CalendarUtils

java.lang.Object
org.apache.commons.lang3.time.CalendarUtils

public class CalendarUtils extends Object
Helps use Calendars.
Since:
3.10
  • Field Details

  • Constructor Details

    • CalendarUtils

      public CalendarUtils(Calendar calendar)
      Creates an instance for the given Calendar.
      Parameters:
      calendar - A Calendar.
  • Method Details

    • getInstance

      public static CalendarUtils getInstance()
      Creates a new instance based on the current time in the default time zone with the default Locale.Category.FORMAT locale.
      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.