Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- myOutput = [ (0,0,12,04),(0,1,0,42),(4,19,27,0) ]
- # or in datetime
- myOutput = [ 00:00:12.04, 00:01:00.42, 4:19:27.00 ]
- # or in milliseconds
- myOutput = [ 12040, 60042, 15582000 ]
- import re
- from dateutil import parser
- d = ["12.04", "1:00.42", "4:19:27"]
- d_sub = [re.sub('.', ':', d_) for d_ in d]
- print([parser.parse(d_) for d_ in d_sub]) # list in datetime format
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement