'Current Date Format using robot framework

I already generated current date and time

${date}=      Get Current Date      UTC      exclude_millis=yes
${convert}=      Convert Date      ${date}      result_format=%Y %a %B %d %H:%M:%S UTC
Log      ${convert}      console=yes

however I'm having difficulties achieving this format.

2022-05-12T22:01:00Z

Tried to append strings however it returns "Keyword (-) found"



Solution 1:[1]

This code gives result you are looking for

*** Settings ***
Library           DateTime
  
*** Test Cases ***   
Test
    ${date}=    Get Current Date    UTC    result_format=%Y-%m-%dT%H:%M:%SZ   exclude_millis=yes
    Log    ${date}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jiri Janous