public DateTimeOffset NearestOf(Double rough) { if (rough <= Dates[0]) { return(Since); } else if (rough >= Dates.Last()) { return(Until); } else { Double dateValue = Dates.Find(a => a >= rough); DateTimeOffset nearest = new DateTimeOffset(DateTime.FromOADate(dateValue), TimeSpan.Zero); return(nearest); } }