Python does not let me format time.

Thomas Wouters thomas at
Fri Apr 28 22:57:28 CEST 2000

On Fri, Apr 28, 2000 at 01:14:46AM +0000, Remco Gerlich wrote:
> Sindh wrote in comp.lang.python:
> > If there is already a moduls to do the same , much helpful.

> >>> import time
> >>> time.strptime("00/04/28","%y/%m/%d")
> (2000,04,17,0,0,0,6,1,0)

> strptime is the inverse of strftime, in a way.

But unfortunately, not all operating systems supply it, and if they do not,
then the time module doesn't, either. If you expect your app to be portable,
dont rely on time.strptime ;) (Or write a replacement strptime, of course,
and get it included in the standard time module. I'd like that a lot, but
haven't the time to figure out all the gory strptime details.)

Thomas Wouters <thomas at>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!

More information about the Python-list mailing list