Function calculateTermDurationInSeconds