RobotFramework:日期格式转换问题

RobotFramework:日期格式转换问题,robotframework,date-format,Robotframework,Date Format,我不确定这里出了什么问题。我已经给出了转换时间、时间格式和结果格式,如下所示: ${date_to_search_for}= Convert Date 2017-06-14 13:03:02.506610 date_format=%Y-%m-%d 00:00:00.00000 result_format=%d %b %Y 00:00:00 exclude_millis=True Log to console ${date_to_search_for} 运行此代码会出现以下错误: V

我不确定这里出了什么问题。我已经给出了转换时间、时间格式和结果格式,如下所示:

${date_to_search_for}=  Convert Date  2017-06-14 13:03:02.506610  date_format=%Y-%m-%d 00:00:00.00000  result_format=%d %b %Y 00:00:00  exclude_millis=True
Log to console  ${date_to_search_for}
运行此代码会出现以下错误:

ValueError: time data '2017-06-14 13:03:02.506610' does not match format '%Y-%m-%d 00:00:00.00000'

我仔细检查了两种格式,看不出有什么不同!我不明白为什么会抛出此错误。

您给Robot的日期:

2017-06-14 13:03:02.506610
这不是你所说的格式

date_format=%Y-%m-%d 00:00:00.00000
请使用DateTime的Python格式,如下所示:

${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 %b %Y 00:00:00    exclude_millis=True
Log to console  ${date_to_search_for}
请注意%H:%M:%S.%f以满足您的时间要求

%H = 24 Hour Hour Time
%M = Minute with leading 0
%S = seconds with leading 0
%f = microseconds with leading 0
一切都可以找到

这将导致记录以下格式:

${date_to_search_for} = 14 Jun 2017 00:00:00

如有任何问题,请询问:

您给Robot的日期:

2017-06-14 13:03:02.506610
这不是你所说的格式

date_format=%Y-%m-%d 00:00:00.00000
请使用DateTime的Python格式,如下所示:

${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 %b %Y 00:00:00    exclude_millis=True
Log to console  ${date_to_search_for}
请注意%H:%M:%S.%f以满足您的时间要求

%H = 24 Hour Hour Time
%M = Minute with leading 0
%S = seconds with leading 0
%f = microseconds with leading 0
一切都可以找到

这将导致记录以下格式:

${date_to_search_for} = 14 Jun 2017 00:00:00

有什么问题请问:

啊,伙计,对不起,金发女郎节。为我辩护,还没有咖啡。谢谢,没有问题,伙计,我们都会遇到的!:DWait…仍然收到一个问题ValueError:时间数据'2017-06-14 13:03:02.506610'与格式“%Y-%m-%d 00:00:00.000000”不匹配让我检查一下-我会在我的机器上安装Robot,给我几分钟时间,我会为你排序啊,伙计,对不起,金发女郎。为我辩护,还没有咖啡。谢谢,没有问题,伙计,我们都会遇到的!:DWait…仍在获取一个问题值错误:时间数据“2017-06-14 13:03:02.506610”与格式“%Y-%m-%d 00:00:00.000000”不匹配让我检查一下-我将在我的机器上设置Robot,给我几分钟时间,然后为您排序