[Tutor] time.strptime in Active State Python 2.1

Allan Crooks allan.crooks@btinternet.com
Tue, 12 Jun 2001 02:58:10 +0100


> PythonWin 2.1 (#15, Apr 23 2001, 18:00:35) [MSC 32 bit (Intel)] on win32.
> Portions Copyright 1994-2001 Mark Hammond (MarkH@ActiveState.com) - see 
> 'Help/About PythonWin' for further copyright information.
> <snip>
>  >>> time.strptime('06/11/01 20:27:24',[])
> Traceback (most recent call last):
>    File "<interactive input>", line 1, in ?
> AttributeError: 'time' module has no attribute 'strptime'

You're trying to access the wrong function, I believe.

>>> import time
>>> dir(time)
['__doc__', '__name__', 'accept2dyear', 'altzone', 'asctime', 'clock', 'ctime',
'daylight', 'gmtime', 'localtime', 'mktime', 'sleep', 'strftime', 'time', 'timez
one', 'tzname']
>>> time.strftime
<built-in function strftime>
>>>

It's STRFTIME, if that's not clear. :)

Allan.