RobotFramework - 转换已经在它
问题描述:
林毫秒的日期将在以下日期RobotFramework - 转换已经在它
${converted_randomization_date}= Convert Date 2017-01-03 00:00:00.000 date_format=%Y-%m-%d %H:%M:%S.%s result_format=%Y-%M-%d exclude_millis=False
但收到以下错误
ValueError: 's' is a bad directive in format '%Y-%m-%d %H:%M:%S.%s'
这是为什么?毫秒是不是由%s表示
答
使用%f
微秒 - 不要担心,实际上你提供的毫秒数是that's the python's formatting string for them。
${converted_randomization_date}= Convert Date 2017-01-03 00:00:00.000 date_format=%Y-%m-%d %H:%M:%S.%f result_format=%Y-%M-%d exclude_millis=False
Log To Console ${converted_randomization_date}
# logs 2017-00-03