time module - is strptime available under NT?

Ruediger Maehl ruediger.maehl at web.de
Wed Jun 27 14:24:32 CEST 2001


Dan Tropp wrote
>Is this function available in the windows (NT) version?
>
>If not is there a commonly used alternative? Or do people just parse things
>up themselves with re?
>
>dan
>
>Dan Tropp
>Dept Psychology, University of Melbourne, Australia

Hi Dan,

no, it is not available. I am using the mxDateTime package from
http://www.lemburg.com/files/python

import DateTime.ISO
# in the latest version you must use:
# import mx.DateTime

t = '2001-06-26 09:00:00'
dt = DateTime.ISO.ParseDateTime(t)
print dt

dt is a DateTime-object and you can then apply all methods
from the DateTime package.

HTH,
Rüdiger





More information about the Python-list mailing list