Class DateUtils


  • public final class DateUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      DateUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isDatePassed​(Date date)
      Checks whether the given date has passed or not by comparing it with the current device time.
      static int yearsPassedFrom​(Date fromDate)
      Number of full years passed from the given date.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DateUtils

        public DateUtils()
    • Method Detail

      • yearsPassedFrom

        public static int yearsPassedFrom​(@NonNull
                                          Date fromDate)
        Number of full years passed from the given date. It is calculated as difference between now and the given date. Now is the current time on the device.
        Returns:
        number of full years passed from the given date.
      • isDatePassed

        public static boolean isDatePassed​(@NonNull
                                           Date date)
        Checks whether the given date has passed or not by comparing it with the current device time.
        Returns:
        true if the date has passed, false otherwise.