Added time2rev() to calculate an orbit number for a given time.