.net 如何在IronPython中使用datetime模块?

.net 如何在IronPython中使用datetime模块?,.net,python,datetime,ironpython,.net,Python,Datetime,Ironpython,我正在尝试将我的一个程序从运行在CPython解释器上移植到IronPython。让我感到困惑的最新部分是我使用datetime模块中的datetime类的地方。下面是我尝试使用strtime函数时发生的情况 » from datetime import datetime » dt = datetime.strptime("21/11/06 16:30", "%d/%m/%y %H:%M") Traceback (most recent call last): File "<string&

我正在尝试将我的一个程序从运行在CPython解释器上移植到IronPython。让我感到困惑的最新部分是我使用datetime模块中的datetime类的地方。下面是我尝试使用strtime函数时发生的情况

» from datetime import datetime
» dt = datetime.strptime("21/11/06 16:30", "%d/%m/%y %H:%M")
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'type' object has no attribute 'strptime'
» 
»从日期时间导入日期时间
»dt=datetime.strtime(“2006年11月21日16:30,“%d/%m/%y%H:%m”)
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
AttributeError:“type”对象没有属性“strTime”
» 

在IronPython中,有什么东西使datetime特别不同吗?

没有特别的原因,
datetime.strTime
在IronPython 2.7.1之前一直缺失。如果您使用的是较旧的版本,您可以使用
time.strtime

谢谢,但是这个版本有多新?大约一周前,我刚从codeplex网站进行了一次新的安装,它遇到了这个问题。10月21日。如果sys.version是2.7.1(或者它在启动ipy.exe时说‘IronPython2.7.1…’,那么就得到了最新版本。哇,我想我是在那之前一天下载的。谢谢!