RobotFramework:转换日期以获取月份名称

时间:2017-06-19 13:39:45

标签: robotframework date-format

转换所需的日期格式天数 MMM 的任何网站,但这不起作用。我什么时候......

${date_to_search_for}=  Convert Date  2017-06-14 13:03:02.506610  date_format=%Y-%M-%d %H:%m:%S.%f  result_format=%d %MMM %Y 00:00:00  exclude_millis=True

我得到了

14 06MM 2017 00:00:00

显然我在这个例子中寻找Jun

1 个答案:

答案 0 :(得分:2)

%MMM is not a valid directive in datetime. You want to use %b if you want a month's abbreviated name. Your result_format should be:

result_format=%d %b %Y 00:00:00