import time


def GetAgeTupleFromRequest(request, default_days=90):
  """Check the request for start/end times and return aff4 age tuple."""
  now = int(time.time() * 1e6)
  default_start = now - (60*60*24*1e6*default_days)
  start_time = int(request.REQ.get("start_time", default_start))
  end_time = int(request.REQ.get("end_time", now))
  return (start_time, end_time)