Search code examples
robotframework

How to convert date format from ddmmyyyy to dd.mm.yyyy base on eclipse python robot framework


I am getting date in this format 20210701 and I want to convert it to this format 01.07.2021


Solution

  • You can use the standard library DateTime and Convert Date in it - specify the format of your input date, and the format you want it processed in:

    ${bb}=    Convert Date    20210701  date_format=%Y%m%d      result_format=%d.%m.%Y    
    Log To Console    ${bb]    # prints "01.07.2021"