Class CBLDate

java.lang.Object
com.softwaremining.util.CBLDate
Direct Known Subclasses:
CenturyDate, CurrentDate

public class CBLDate extends Object
  • Field Details

  • Constructor Details

    • CBLDate

      public CBLDate()
    • CBLDate

      public CBLDate(String dateFormat)
    • CBLDate

      public CBLDate(long millis)
    • CBLDate

      public CBLDate(Date date)
    • CBLDate

      public CBLDate(LocalDateTime date)
  • Method Details

    • getDay

      public final int getDay()
      Returns the Day-of-Month
    • getDayString

      public final String getDayString()
      returns day of month as a string
    • getMonth

      public int getMonth()
      COBOL version of month - January is month 1
      (in Java Month starts from 0)
      Returns:
    • getMonthString

      public String getMonthString()
      COBOL version of month - January is month 1
      (in Java Month starts from 0)
      Returns:
      Stringified month
    • getYear

      public int getYear()
    • getYearString

      public String getYearString()
      returns the last 2 digit of current year
      Returns:
    • setDay

      public void setDay(int day)
      Set Day-Of-Month
      Parameters:
      day -
    • getDayOfWeek

      public static int getDayOfWeek()
      COBOL reprsentation of day-of-week. 1 is Monday ... 7 is Sunday.
      Returns:
    • getDayOfWeekString

      public static String getDayOfWeekString()
    • getYearAndDayOfYear

      public static String getYearAndDayOfYear()
      for translation of COBOL ACCEPT x5 FROM DAY The first 2 character is the Year (00-99) The remaining 5 character is Day-of-year. (1,366)
      Returns:
    • getYearOfCentury

      public static String getYearOfCentury()
      returns the last 2 digit of current year
      Returns:
    • getDayOfYear

      public static int getDayOfYear()
    • getDayOfYearString

      public static String getDayOfYearString()
      get Day of year (1-366)
      Returns:
    • getFormatted

      public String getFormatted()
      returns format : yyMMdd
      Returns:
    • getCenturyFormatted

      public String getCenturyFormatted()
      return date in format: yyyyMMdd
      Returns:
    • getCurrentDateFormatted

      public String getCurrentDateFormatted()
      return date in format: yyyyMMddHHmmSS.nano.
      Returns:
    • getFormattedCenturyFormatted

      public String getFormattedCenturyFormatted()
    • getUSFormattedDate

      public String getUSFormattedDate()
      String representing the date with century E.g. for 2010-01-29 it will "100129"
    • getTime

      public long getTime()
    • toString

      public String toString()
      String representing the date E.g. for 2010-12-29 it will return "122910"
      Overrides:
      toString in class Object
    • toInteger

      public int toInteger()
      integer representing the date E.g. for 2010-01-29 it will return 100129