Interface DateTimeDataValue

    • Method Detail

      • getHours

        NumberDataValue getHours​(NumberDataValue result)
                          throws StandardException
        Get the hour of the day out of a time or timestamp.
        Parameters:
        result - The result of the previous call to this method, null if not called yet.
        Returns:
        A NumberDataValue containing the hour of the day.
        Throws:
        StandardException - Thrown on error
      • getMinutes

        NumberDataValue getMinutes​(NumberDataValue result)
                            throws StandardException
        Get the minute of the hour out of a time or timestamp.
        Parameters:
        result - The result of the previous call to this method, null if not called yet.
        Returns:
        A NumberDataValue containing the minute of the hour.
        Throws:
        StandardException - Thrown on error
      • getSeconds

        NumberDataValue getSeconds​(NumberDataValue result)
                            throws StandardException
        Get the second of the minute out of a time or timestamp.
        Parameters:
        result - The result of the previous call to this method, null if not called yet.
        Returns:
        A NumberDataValue containing the second of the minute.
        Throws:
        StandardException - Thrown on error
      • timestampAdd

        DateTimeDataValue timestampAdd​(int intervalType,
                                       NumberDataValue intervalCount,
                                       java.sql.Date currentDate,
                                       DateTimeDataValue resultHolder)
                                throws StandardException
        Add a number of intervals to a datetime value. Implements the JDBC escape TIMESTAMPADD function.
        Parameters:
        intervalType - One of FRAC_SECOND_INTERVAL, SECOND_INTERVAL, MINUTE_INTERVAL, HOUR_INTERVAL, DAY_INTERVAL, WEEK_INTERVAL, MONTH_INTERVAL, QUARTER_INTERVAL, or YEAR_INTERVAL
        intervalCount - The number of intervals to add
        currentDate - Used to convert time to timestamp
        resultHolder - If non-null a DateTimeDataValue that can be used to hold the result. If null then generate a new holder
        Returns:
        startTime + intervalCount intervals, as a timestamp
        Throws:
        StandardException
      • timestampDiff

        NumberDataValue timestampDiff​(int intervalType,
                                      DateTimeDataValue time1,
                                      java.sql.Date currentDate,
                                      NumberDataValue resultHolder)
                               throws StandardException
        Finds the difference between two datetime values as a number of intervals. Implements the JDBC TIMESTAMPDIFF escape function.
        Parameters:
        intervalType - One of FRAC_SECOND_INTERVAL, SECOND_INTERVAL, MINUTE_INTERVAL, HOUR_INTERVAL, DAY_INTERVAL, WEEK_INTERVAL, MONTH_INTERVAL, QUARTER_INTERVAL, or YEAR_INTERVAL
        time1 -
        currentDate - Used to convert time to timestamp
        resultHolder - If non-null a DateTimeDataValue that can be used to hold the result. If null then generate a new holder
        Returns:
        the number of intervals by which this datetime is greater than time1
        Throws:
        StandardException