java.lang.Object
io.github.tonywasher.joceanus.oceanus.date.OceanusDateUtils

public final class OceanusDateUtils extends Object
Date utilities.
  • Method Details

    • startPeriod

      public static OceanusDate startPeriod(OceanusDate pDate, OceanusDatePeriod pPeriod)
      Obtain the date of the start of the period.
      Parameters:
      pDate - the date to adjust
      pPeriod - the period to adjust by
      Returns:
      the adjusted date
    • endNextMonth

      public static OceanusDate endNextMonth(OceanusDate pDate)
      Obtain the date of the end of the following month.
      Parameters:
      pDate - the date to adjust
      Returns:
      the date
    • startCalendarMonth

      public static OceanusDate startCalendarMonth(OceanusDate pDate)
      Obtain the date of the start of the month.
      Parameters:
      pDate - the date to adjust
      Returns:
      the date
    • endCalendarMonth

      public static OceanusDate endCalendarMonth(OceanusDate pDate)
      Obtain the date of the end of the month.
      Parameters:
      pDate - the date to adjust
      Returns:
      the date
    • startCalendarQuarter

      public static OceanusDate startCalendarQuarter(OceanusDate pDate)
      Obtain the date of the start of the quarter.
      Parameters:
      pDate - the date to adjust
      Returns:
      the date
    • startCalendarYear

      public static OceanusDate startCalendarYear(OceanusDate pDate)
      Obtain the date of the start of the year.
      Parameters:
      pDate - the date to adjust
      Returns:
      the date
    • endCalendarYear

      public static OceanusDate endCalendarYear(OceanusDate pDate)
      Obtain the date of the end of the year.
      Parameters:
      pDate - the date to adjust
      Returns:
      the date
    • startFiscalYear

      public static OceanusDate startFiscalYear(OceanusDate pDate)
      Adjust the date to the start of the fiscal year.
      Parameters:
      pDate - the date to adjust
      Returns:
      the date
    • ageOn

      public static int ageOn(OceanusDate pBirthDate, OceanusDate pDate)
      Calculate the age that someone born on a particular date will be on a given date.
      Parameters:
      pBirthDate - the birthDate
      pDate - the date for which to calculate the age
      Returns:
      the age on that date