(no subject)

Gerrit Holl gerrit at nl.linux.org
Thu Jun 5 15:12:09 EDT 2003


Leeds, Mark schreef op donderdag  5 juni om 20:56:34 +0000:
> i'm a python beginner but I have three books and i couldn't find an
> answer to the following question.
>  
> i have a date, say as a string 26Nov2002 and i want to convert it to a
> string 20021126.
>  
> it's probably possible to write a function to do this by creating
> a table of months to numbers but I was hoping that
> there was some kind of python function i could use instead ?

time.strptime does what you want.

http://www.python.org/dev/doc/devel/lib/module-time.html#l2h-1676

yours,
Gerrit.

-- 
11. If the owner do not bring witnesses to identify the lost article,
he is an evil-doer, he has traduced, and shall be put to death.
        -- 1780 BC, Hammurabi, Code of Law
--
Asperger Syndroom - een persoonlijke benadering:
	http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
	http://www.sp.nl/





More information about the Python-list mailing list