java.lang.Object
org.apache.poi.ss.formula.functions.Days
All Implemented Interfaces:
FreeRefFunction

public class Days extends Object implements FreeRefFunction

Calculates the number of days between two dates based on a real year, which is used in some accounting calculations.

DAYS(end_date,start_date)

  • Start_date, end_date (required):
    The two dates between which you want to know the number of days.
    If start_date occurs after end_date, the DAYS function returns a negative number.
See Also:
  • Field Details

    • instance

      public static final Days instance
  • Method Details

    • evaluate

      public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec)
      Specified by:
      evaluate in interface FreeRefFunction
      Parameters:
      args - the pre-evaluated arguments for this function. args is never null, nor are any of its elements.
      ec - primarily used to identify the source cell containing the formula being evaluated. may also be used to dynamically create reference evals.
      Returns:
      never null. Possibly an instance of ErrorEval in the case of a specified Excel error (Exceptions are never thrown to represent Excel errors).