If you want to get the seconds since epoch, you can use python-dateutil
to convert it to a datetime
object and then convert it so seconds using the strftime
method. Like so:
>>> import dateutil.parser as dp
>>> t="1984-06-02T19:05:00.000Z"
>>> parsed_t = dp.parse(t)
>>> t_in_seconds = parsed_t.timestamp()
>>> t_in_seconds
'455051100'
So you were halfway there 🙂