# Datetime Compare

This function block allows you to compare two date and time values. It can also be used to obtain the current date if the required inputs are not provided.

## 📥 Inputs <a href="#inputs" id="inputs"></a>

`Input Date` A string input representing the date and time value that you want to compare (in the format `YYYY-MM-DD HH:MM:SS`).

`Year` A string input for the year part of the date to compare.

`Month` A string input for the month part of the date to compare.

`Date` A string input for the day part of the date to compare.

`Hour` A string input for the hour part of the time to compare.

`Minute` A string input for the minute part of the time to compare.

`Second` A string input for the second part of the time to compare.

## 📤 Outputs <a href="#outputs" id="outputs"></a>

`Boolean` A boolean output that indicates the result of the comparison between the input date and the constructed reference date.

## 🕹️ Controls <a href="#controls" id="controls"></a>

`Relation` A dropdown menu that allows you to select the type of comparison to perform. The available options are:

* Equal to (`==`)
* Not equal to (`!=`)
* Less than (`<`)
* Less than or equal to (`<=`)
* Greater than or equal to (`>=`)
* Greater than (`>`)

## 🎨 Features <a href="#features" id="features"></a>

`Flexible Date Construction` Users can leave input fields empty, and the current date and time will be used automatically.

`Comprehensive Comparison Options` Different types of comparisons allow for versatile evaluations of date and time attributes.

## 📝 Usage Instructions <a href="#usage" id="usage"></a>

1. **Provide Input Date**: Connect a string input that represents the date and time you want to compare.
2. **Set Reference Date Fields**: You may set the year, month, day, hour, minute, and second as desired. Leave any of these empty to default to the current date and time.
3. **Select Comparison Type**: Choose the type of comparison you want to perform from the `Relation` dropdown.
4. **Evaluate**: Run the function block to perform the comparison. The output will tell you whether the condition is met.

## 📊 Evaluation <a href="#evaluation" id="evaluation"></a>

On execution, the function block compares the provided date against the constructed reference date and returns a boolean indicating the result.

## 💡 Tips and Tricks <a href="#tips-and-tricks" id="tips-and-tricks"></a>

<details>

<summary>Check Current Date</summary>

To quickly check against today's date without providing any additional inputs, simply connect an empty string to the `Input Date` input, and the current date will be used.

</details>

<details>

<summary>Using New Dates</summary>

Ensure that the input date string is in the correct format (`YYYY-MM-DD HH:MM:SS`) to avoid parsing errors.

</details>

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

<details>

<summary>Date Format Error</summary>

If you receive an error about date formatting, double-check that your input date matches the expected format: `YYYY-MM-DD HH:MM:SS`.

</details>

<details>

<summary>Incorrect Comparison Result</summary>

If the output does not match your expectations, verify that you have selected the correct relation type and that all date components are entered correctly.

</details>
