# Date Difference

> Kalipso Studio 6.1 documentation · https://doc.sysdevmobile.com/kalipso/6.1/documentation/expressions/functions/date-functions/date-difference
>
> DateDiff returns the number of days between two dates in YYYYMMDD format, always as a positive number or zero.

This Function returns a _\<numeric>_, which is the number of days between the specified **Date 1** and **Date 2**.

### Parameters

* **Date 1** _\<string> -_ Date to subtract the **Date 2** from. This parameter must be in format YYYYMMDD.
* **Date 2** _\<string> -_ Date to subtract from **Date 1**. This parameter must be in format YYYYMMDD.

### **Examples**

* _Example 1_

DateDiff("20100307", "20100301")\
**Result** = 6

* _Example 2_

DateDiff("20100301", "20100307")\
**Result** = 6

:::info
If **Date 1** is later than **Date 2**, the parameters order is inverted in runtime. Therefore, the result of this function is always a positive number or zero.
:::
