So I am working on a database for airports and i want to find the duration of flight. There is a table named flight that has id... dep_time(departure time), arr_time(arrival time) declared as time without time zone.
The problem is that one of the flights departs at 23:00:00 and arrives at 02:00:00 of the next day.
So in general i was using arr_time - dep_time but that gives me a negative result for the specific flight (-21:00:00).
So what i want to get to is that by chance I used - dep_time + arr_time and got the right result (03:00:00)... Can someone explain? I am so confused
(I dont want a solution cause I got it, I would like an explanation. Also I have to use time and not timevariable as it is specified in the project)
EDIT#1: Guys I dont want a solution for the problem, I have solved it. I want to know why there is a difference in the result while there shouldnt be.