> ## 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.

# TIMECOMPARE

> The TIMECOMPARE function compares two dates and can be used across various YiDA scenarios. It accepts two timestamp parameters and returns a boolean value indicating the comparison result.

The **TIMECOMPARE** function compares two dates.

## Supported Scenarios

The TIMECOMPARE function is supported in the following YiDA scenarios:

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

## Syntax

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
TIMECOMPARE(end_time,start_time)
```

## Attributes

<table>
  <tr>
    <td>**Attribute**</td>
    <td>**Required**</td>
    <td>**Description**</td>
  </tr>

  <tr>
    <td>start\_time</td>
    <td>Yes</td>
    <td rowSpan={2}>The timestamps to compare. You can reference a date picker directly.</td>
  </tr>

  <tr>
    <td>end\_time</td>
    <td>Yes</td>
  </tr>
</table>

## Return Value

| **Return type** | **Description**                                                                                                                                                                        |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Boolean         | The comparison result of the two timestamps:<br />• **true**: **start\_time** is greater than **end\_time**.<br />• **false**: **start\_time** is less than or equal to **end\_time**. |

## Example

As shown below, you can use the `TIMECOMPARE()` function to compare the values of two date components.

## Try It Out

Compare two timestamps. If **Date 1** is greater than **Date 2**, the function returns **true**; otherwise, it returns **false**.
