split db rows based on a given time difference