luofeiyu <[email protected]> writes:
> s="Aug"
>
> how can i change it into 8 with some python time module?
What is your purpose here? If you want to parse a text value into a
structured time object, don't do it piece by piece. Use the
‘time.strptime’ function.
>>> import time
>>> input_time_text = "14 Aug 2014"
>>> input_time = time.strptime(input_text, "%d %b %Y")
>>> input_time.tm_mon
8
--
\ “I knew it was a shocking thing to say, but … no-one has the |
`\ right to spend their life without being offended.” —Philip |
_o__) Pullman, 2010-03-28 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list