def _get_digest_timestamps():
    # From the current time
    now = time.gmtime()

    # Go back to midnight
    digest_end_time = calendar.timegm([
      now.tm_year,
      now.tm_mon,
      now.tm_mday,
      0,
      0,
      0,
      now.tm_wday,
      now.tm_yday,
      now.tm_isdst
    ])

    digest_start_time = digest_end_time - DIGEST_LENGTH_SEC

    # Twitter data can be as stale as the digest end time, since we don't care
    # about anything more recent (there may be some concurrency issues with
    # parallell invocations, but they're unlikely to actually matter at the load
    # we're expecting.
    max_cache_age = calendar.timegm(now) - digest_end_time

    return digest_start_time, digest_end_time, max_cache_age
dataset/ETHPy150Open mihaip/streamspigot/app/tweetdigest/data.py/_get_digest_timestamps/original