Немного смущает, если честно.Не могли бы вы немного подробнее рассказать о своей главной цели и дать больше информации о том, как дата отображается в вашем файле Excel.
second edit * |Я попытался прокомментировать то, что я пишу в коде.
Я сделал похожий пример, просто чтобы понять, чем я могу вам помочь.
Вот так выглядит мой файл Excel:
![enter image description here](https://i.stack.imgur.com/Q4AIG.png)
Вот как выглядит код для чтения и вычисления различий очень простым способом:
import pandas as pd
df = pd.read_excel('dates.xlsx') #reading my excel
timeStart = [] #declaring 2 lists where I'm gonna put my records
timeEnd = []
#Here I append my values from the excel to my lists
for value in df.get('col1'):
timeStart.append(value)
for value in df.get('col2'):
timeEnd.append(value)
#I suppose they both have the same amount of elements in list
#therefore I can iterate for the len of any list between timeStart and timeEnd
for i in range(len(timeStart)):
#datetime.time object doesn't allow '-' operator to catch it's time difference,
#you can calculate it like this having how much hours, minutes or seconds
#spent working. Or you can just concatenate all 3 results to get it all.
hours = timeEnd[i].hour - timeStart[i].hour #hours difference
minutes = timeEnd[i].minute - timeStart[i].minute #minutes difference
seconds = timeEnd[i].second - timeStart[i].second #second difference
print(type(hours), type(minutes), type(seconds)) #all my results are int
print(hours, minutes, seconds) #I can see the difference from one time to another
Эточто я получаю в выводе:
<class 'int'> <class 'int'> <class 'int'> #Here you can see I have 3 int types
1 30 15 #read as 1 hour 30 minutes and 15 seconds
<class 'int'> <class 'int'> <class 'int'>
1 30 15
<class 'int'> <class 'int'> <class 'int'>
1 30 15
<class 'int'> <class 'int'> <class 'int'>
1 30 15
<class 'int'> <class 'int'> <class 'int'>
1 30 15
<class 'int'> <class 'int'> <class 'int'>
1 30 15
<class 'int'> <class 'int'> <class 'int'>
1 30 15
<class 'int'> <class 'int'> <class 'int'>
1 30 15
<class 'int'> <class 'int'> <class 'int'>
1 30 15
[Finished in 0.5s]