79383498

Date: 2025-01-24 07:10:46
Score: 0.5
Natty:
Report link

The other way is using result_format=datetime.

Here is the code example:

*** Settings ***
Library    DateTime

*** Variables ***
${a}     12/30/2023
${b}     12/16/2022
${Date_Format}         %m/%d/%Y

*** Test Cases ***
Test Date
    ${a_date}    Convert Date    ${a}    result_format=datetime    date_format=${Date_Format}
    ${b_date}    Convert Date    ${b}    result_format=datetime    date_format=${Date_Format}
    Log To Console   a is :${a_date}, b is:${b_date}
    IF    $a_date > $b_date
        Log To Console    a is greater than b
    ELSE
        Log To Console    b is greater than a
    END

The result is:result of the code

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Mohsen Khosroanjam