Class DateTimeTodayFunction

  • All Implemented Interfaces:
    FunctionIfc

    @FunctionParameter(name="parameters",
                       isVarArg=true)
    public class DateTimeTodayFunction
    extends AbstractFunction
    Produces a new DATE_TIME that represents the current date, at midnight (00:00).

    It is useful for DATE_TIME comparison, when the current time must not be considered. For example, in the expression:

    IF(expiryDate > DT_TODAY(), "expired", "valid")

    This function may accept an optional time zone to be applied. If no zone ID is specified, the default zone ID defined at the ExpressionConfiguration will be used.

    Author:
    oswaldobapvicjr
    • Constructor Detail

      • DateTimeTodayFunction

        public DateTimeTodayFunction()
    • Method Detail

      • evaluate

        public EvaluationValue evaluate​(Expression expression,
                                        Token functionToken,
                                        EvaluationValue... parameterValues)
                                 throws EvaluationException
        Description copied from interface: FunctionIfc
        Performs the function logic and returns an evaluation result.
        Parameters:
        expression - The expression, where this function is executed. Can be used to access the expression configuration.
        functionToken - The function token from the parsed expression.
        parameterValues - The parameter values.
        Returns:
        The evaluation result in form of a EvaluationValue.
        Throws:
        EvaluationException - In case there were problems during evaluation.