"Bell, Kevin" wrote:

> Anyone aware of existing code to turn a date string "8-15-05" into the
> number 20050815?

date = "8-15-05"

import re
m, d, y = map(int, re.match("(\d+)-(\d+)-(\d+)$", date).groups())
number = 20000000 + y*10000 + m*100 + d

print number

</F> 



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to