Class DateUtility

java.lang.Object
org.tasktide.core.supporting.DateUtility

public class DateUtility extends Object
Utility to handle dates
  • Constructor Details

    • DateUtility

      public DateUtility(String dateFormat, int expiration)
      Constructing because it holds various methods
      Parameters:
      dateFormat -
      expiration -
    • DateUtility

      public DateUtility()
      Construct default utility
  • Method Details

    • getDateLong

      public long getDateLong()
      Get date current time
      Returns:
      long
    • getDate

      public Date getDate()
      Get date from current time
      Returns:
      Date
    • getDateFromTime

      public Date getDateFromTime(long time)
      Get date from provided time
      Parameters:
      time -
      Returns:
      Date
    • formatDate

      public String formatDate(Date date)
      Format provided date to string constant
      Parameters:
      date -
      Returns:
      String
    • getNowString

      public String getNowString()
      Get current date as a string
      Returns:
      String
    • getDateString

      public String getDateString(Date date)
      Get provided date as a string
      Parameters:
      date -
      Returns:
      String
    • parseDate

      public Date parseDate(String date)
      Parse provided date string to Date
      Parameters:
      date -
      Returns:
      Date
    • getExpireDate

      public Date getExpireDate(Date input)
      Get an expirary date for input
      Parameters:
      input -
      Returns:
      Date
    • hasExceeded

      public boolean hasExceeded(Date inputDate)
      Check if provided is before
      Parameters:
      inputDate -
      Returns:
    • getTimeTaken

      public long getTimeTaken(Date startDate, Date endDate)
      Get time taken
      Parameters:
      startDate -
      endDate -
      Returns:
      long