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

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

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

πŸ•ΉοΈ Controls

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

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

  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

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

πŸ’‘ Tips and Tricks

Check Current Date

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.

Using New Dates

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

πŸ› οΈ Troubleshooting

Date Format Error

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

Incorrect Comparison Result

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.

Last updated