I have a data set consisting of time stamps looking as following:
['2019-12-18T12:06:55.697975Z"', '2019-12-18T12:06:55.707017Z"',...]
I need a for
loop which will go through all timestamps and convert each to a time structure. But what I created, does not work - I am not sure about data types and also about indexing when using strings.
My attempt is following:
from time import struct_time
for idx in enumerate(tm_str): #tm_str is a string:['2019-12-18T12:06:55.697975Z"', ...]
a=idx*30+2 #a should be first digit in year - third position in string -
b=idx*30+6 # b should last dgit of year, 30 is period to next year
tm_year=tm_str[a:b]
Month, day, hour etc. should be done is similar way.