Class DateTimeObject

java.lang.Object
quadbase.reportdesigner.lang.DateTimeObject
All Implemented Interfaces:
IObject, IFunctionConstants

public class DateTimeObject extends Object implements IObject, IFunctionConstants
This class is used to implement formulas for columns contain data/time data
  • Constructor Details

    • DateTimeObject

      public DateTimeObject(String date)
      Creates a new DateTimeObject using specified String
    • DateTimeObject

      public DateTimeObject(StringObject date)
      Creates a new DateTimeObject using specified StringObject
    • DateTimeObject

      public DateTimeObject(Date date)
      Creates a new DateTimeObject using specified Date
    • DateTimeObject

      protected DateTimeObject(String formula, int sqlType)
      Creates a new DateTimeObject using specified formula and SQL type
  • Method Details

    • getFormula

      public String getFormula()
      Returns the formula
      Specified by:
      getFormula in interface IObject
    • getSQLType

      public int getSQLType()
      Returns the SQL type
      Specified by:
      getSQLType in interface IObject
    • getColumnValue

      public static DateTimeObject getColumnValue(int colInfoIndex)
      Gets the column value at specified column
    • getColumnValue

      public static DateTimeObject getColumnValue(int colInfoIndex, int sqlType)
      Gets the column value at specified column
    • getColumnValue

      public static DateTimeObject getColumnValue(NumericObject colInfoIndex, int sqlType)
      Gets the column value at specified column
    • getColumnValue

      public static DateTimeObject getColumnValue(int colInfoIndex, short aggregation)
      Gets the column value at specified column after applying specified aggregation. List of possible aggregations is in @link quadbase.reportdesigner.util.IAggregateConstants
    • getColumnValue

      public static DateTimeObject getColumnValue(int colInfoIndex, short aggregation, int sqlType)
      Gets the column value at specified column after applying specified aggregation. List of possible aggregations is in @link quadbase.reportdesigner.util.IAggregateConstants
    • getColumnValue

      public static DateTimeObject getColumnValue(NumericObject colInfoIndex, short aggregation, int sqlType)
      Gets the column value at specified column after applying specified aggregation. List of possible aggregations is in @link quadbase.reportdesigner.util.IAggregateConstants
    • getCurrentDateTime

      public static DateTimeObject getCurrentDateTime()
      Returns the current date and time
    • getCurrentDate

      public static DateTimeObject getCurrentDate()
      Returns the current date
    • getCurrentTime

      public static DateTimeObject getCurrentTime()
      Returns the current time
    • add

      public static DateTimeObject add(DateTimeObject date, short calendarField, NumericObject amt)
      Add amt to Calendar Field part of the Date

      Calendar Field : quadbase.reportdesigner.util.IFunctionConstants.ERA quadbase.reportdesigner.util.IFunctionConstants.YEAR quadbase.reportdesigner.util.IFunctionConstants.MONTH quadbase.reportdesigner.util.IFunctionConstants.WEEK_OF_YEAR quadbase.reportdesigner.util.IFunctionConstants.WEEK_OF_MONTH quadbase.reportdesigner.util.IFunctionConstants.DATE quadbase.reportdesigner.util.IFunctionConstants.DAY_OF_MONTH quadbase.reportdesigner.util.IFunctionConstants.DAY_OF_YEAR quadbase.reportdesigner.util.IFunctionConstants.DAY_OF_WEEK quadbase.reportdesigner.util.IFunctionConstants.DAY_OF_WEEK_IN_MONTH quadbase.reportdesigner.util.IFunctionConstants.AM_PM quadbase.reportdesigner.util.IFunctionConstants.HOUR quadbase.reportdesigner.util.IFunctionConstants.HOUR_OF_DAY quadbase.reportdesigner.util.IFunctionConstants.MINUTE quadbase.reportdesigner.util.IFunctionConstants.SECOND quadbase.reportdesigner.util.IFunctionConstants.MILLISECOND

      See Also:
    • roll

      public static DateTimeObject roll(DateTimeObject date, short calendarField, NumericObject amt)
      Rolls amt to the Calendar Field part of Date. Note that here except for the Calendar Field of the Date, no other field is affected. In event of an overflow, the field rolls over
    • getDateTime

      public static NumericObject getDateTime(DateTimeObject date, short calendarField)
      Gets the value of a specified field from the DateTimeObject
    • getDayDifference

      public static NumericObject getDayDifference(DateTimeObject date1, DateTimeObject date2)
      Returns the difference in number of days between the two DateTimeObjects
    • getDayOfWeek

      public static StringObject getDayOfWeek(DateTimeObject date)
      Returns the day of the week
    • getMonth

      public static StringObject getMonth(DateTimeObject date)
      Returns the month
    • getAmPm

      public static StringObject getAmPm(DateTimeObject date)
      Returns AM or PM depending on the time of the DateTimeObject
    • getERA

      public static StringObject getERA(DateTimeObject date)
      Returns the ERA of the DateTimeObject
    • printDateTime

      public static StringObject printDateTime(DateTimeObject date)
      Prints the date and time
    • printDateTime

      public static StringObject printDateTime(DateTimeObject date, StringObject pattern)
      Prints the date and time in the specified format
    • printTime

      public static StringObject printTime(DateTimeObject date)
      Prints the time
    • printTime

      public static StringObject printTime(DateTimeObject date, StringObject pattern)
      Prints the time in the specified format
    • printDate

      public static StringObject printDate(DateTimeObject date)
      Prints the date
    • printDate

      public static StringObject printDate(DateTimeObject date, StringObject pattern)
      Prints the date in the specified format