I reduced the whole script to the minimun, now I haven't this type error... I have to look in a second step why and when I get this error.
In this next code example there is no error. When I subtract all x values from the x[0] then the values on the x axis aren't in time format, see picture.
import pandas as pd
import matplotlib.pyplot as plt
import time
import datetime
from datetime import timedelta
data_path = "C:/.../"
data_file = "..."
row_data_start = 0
mydata = pd.read_excel(data_path + data_file, skiprows=2)
x = mydata.iloc[row_data_start:,0].values
y1 = mydata.iloc[row_data_start:,1].values
y5 = mydata.iloc[row_data_start:,4].values
y4 = mydata.iloc[row_data_start:,3].values
x = x-x[0]
fig, ax = plt.subplots(ncols=1, nrows=2, dpi=300)
twin1 = ax[0].twinx()
twin1ax1 = ax[1].twinx()
p1, = ax[0].plot(x, y1, ".k-")
p4, = twin1.plot(x, y4, ".b-")
ax[1].plot(x, y5, "r-")
plt.show()
console print(x):
[ 0 10000000000 20000000000 30000000000 40000000000
50000000000 60000000000 70000000000 80000000000 90000000000
100000000000 110000000000 120000000000 130000000000 140000000000
150000000000 160000000000 170000000000 180000000000 190000000000
200000000000]
Variable explorer of the input x values:
0 2022-08-04 08:56:22
1 2022-08-04 08:56:32
2 2022-08-04 08:56:42
.
.
.

How I can format the elapsed time from x[0] to hh:mm:ss?