public static List<Long> epochDays(long endTs, long lookback) {
    long to = midnightUTC(endTs);
    long startMillis = endTs - (lookback != 0 ? lookback : endTs);
    long from = startMillis <= 0 ? 0 : midnightUTC(startMillis); // >= 1970

    List<Long> days = new ArrayList<>();
    for (long time = from; time <= to; time += TimeUnit.DAYS.toMillis(1)) {
      days.add(time);
    }
    return days;
  }
For bucketed data floored to the day. For example, dependency links.
zipkin/src/main/java/zipkin2/internal/DateUtil.java