Hello.
Just start to learn Arduino platform and get stuck on simple (or not so simple) question.
I have two arrays. Arrays are time got from RTC DS1307. Event start time is in first array, event end time in second.
How do I manage to calculate time spent between events?
Thanks in advance!

subtract the arrays first write the code to store values in one array from DS iC and then at a later point in the program again store the time in the array and then subtract both.

Ok, maybe my question was unclear. Let’s say start time is 13:12:24, end time 14:01:24 arrays ia as follows:
t1[0]=24 t1[1]=12 t1[2]=13
t2[0]=24 t2[1]=01 t2[2]=14
if we substrast start time from stop time:

for (int i = 0, i < 3, i++) {
spent_time[i] = t2[i] - t1[i];
}

we got: spent_time[0] = 0 spent_time[1] = -11 and spent_time[2] = 01

Got strange behavior from calculating time using karl_b formula.
If time difference more than 1h and 10min, getting result with minus sign!

Let's say start time 08:00:00, stop time 09:15:00.
the result is -11:-9:-32 !!
I'm totally confused about this, since not so strong in math
karl_b, pls help!

int t1[]={0,0,0,0,0,0,0,};//sec - min - hour - and so on
int t2[]={0,0,0,0,0,0,0,};
int t3[]={0,0,0,0,0,0,0,};
in loop :
long Start = t1[2]*3600 + t1[1]*60 +t1[0];
long Stop = t2[2]*3600 + t1[1]*60 +t2[0];
long Delta = Stop - Start; // Delta is now number of seconds between
int hours = Delta / 3600; // HOURS
Delta = Delta - hours*3600 // removing full hours from teh difference
int minutes = Delta / 60; // MINUTES
Delta = Delta - minutes *60; // removing full minutes
int seconds = Delta; // SECONDS
t3[2] = hours;
t3[1] = minutes;
t3[0] = seconds;

this could be smaller I guess, but I think its easier to understand ?