utc string to unix time conversion python

Viewed 6144

I have a list of UTC time stamps stored as string format as follows:

'20170124T1815'

Is there a function in python to convert these strings to unix time? I have tried:

dt = datetime.datetime.utcnow()
calendar.timegm(dt.utctimetuple())
(datetime.datetime.utcnow('20170127T2131').strftime('%Y-%m-%d %H:%M:%S'))

but these have not been working for me as these functions are not meant to take arguments.

1 Answers
Related