> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# CASCADEDATEINTERVALV2

> The CASCADEDATEINTERVALV2 function calculates the difference between the start and end dates in a date range picker component. It supports multiple product scenarios such as forms and workflow design, returning the interval in the specified unit based on the date component, unit type, and offset.

## Supported Product Scenarios

CASCADEDATEINTERVALV2 is supported in the following YiDA scenarios:

* Form (main form fields)
* Form (business association rules)
* Form (validation)
* Workflow design (validation rules)
* Workflow design (association actions)
* Integration and automation
* Workflow node
* Connector

## Format

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
CASCADEDATEINTERVALV2(Date component, type, Offset)
```

## Attribute Description

| **Attribute** | **Required** | **Description**                                                                                     |
| ------------- | ------------ | --------------------------------------------------------------------------------------------------- |
| timestamp     | Yes          | The date range component.                                                                           |
| type          | Yes          | The unit of the difference. Valid values:<br />• **d**: day<br />• **h**: hour<br />• **s**: second |
| Offset        | Yes          | The offset based on the unit length. Can be a positive or negative number.                          |

## Return Value

| **Return value type** | **Description**                     |
| --------------------- | ----------------------------------- |
| Number                | The interval between the two dates. |

## Examples

* Example 1:

For a date range in the format `YYYY-MM-DD`, with a start date of `2023-12-01` and an end date of `2023-12-31`, the formula returns 31.

* Example 2:

For a date range in the format `YYYY-MM-DD HH:mm:ss`, with a start time of `2023-12-01 09:30:00` and an end time of `2023-12-01 18:00:00`, the formula returns 8.5.

## Try It Out

Calculate the interval between the start and end dates in a date range picker component.
