0
我有以下代码:比较datetime.datetime到time.strptime
nowtime = datetime.datetime.now()
newTime = time.strptime(myTimestring, '%Y-%m-%d %H:%M:%S')
if(newTime > nowTime):
#do some stuff
当然,我比较失败了类型错误,“不能datetime.datetime比较元组”。请注意,我使用的是没有datetime.strptime()的较旧版本的Python。我如何才能比较这个工作?
你看http://stackoverflow.com/questions/ 1697815 /你怎么做转换一个python时间结构时间对象到一个日期时间对象? – milancurcic
请说明确切的(旧)python版本,以便我们可以浏览文档并寻求适当的补救措施。 – vonPetrushev