I have this date format (thousands in this form).
time_from = '2020-11-28T06:00:00-06:00'
time_to = '2020-11-28T09:00:00-06:00'
And I want it to transform them into datetime format so I can compute the total # of seconds between the times quickly (see below). I'm thinking a for loop where I go through each hour/day of the string and save them in a list. But, wondering if there's an easier way?
import datetime as dt
a = dt.datetime(2013,12,30,23,59,59)
b = dt.datetime(2013,12,31,23,59,59)
(b-a).total_seconds()