Parsing a date-time string?

Murtog (sent by Nabble.com) lists at nabble.com
Wed Dec 21 22:43:33 EST 2005


Isnt possible to do something like:

In [4]: s = s.split()

In [1]: s = "Mon Dec 19 11:06:12:333 CET 2005"
In [5]: s
Out[5]: ['Mon', 'Dec', '19', '11:06:12:333', 'CET', '2005']
In [6]: day = s[0]
In [7]: month = s[1]
In [8]: day_number = s[3]
In [9]: time = s[4]
In [10]: #....

? So you treat the datetime information using regex or another split method.

Cheers =]
--
Sent from the Python - python-list forum at Nabble.com:
http://www.nabble.com/Parsing-a-date-time-string--t783590.html#a2054748
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20051221/e91b62f4/attachment.html>


More information about the Python-list mailing list