def _translate_time(time):
  """
  Translate time from format:
  Feb  8 01:44:59 EST 2013
  to format:
  2013/03/06-00:17:54
  """
  # get all parts
  time_parts = time.split()
  # do we have the correct number of parts?
  if len(time_parts) != 5:
    raise Exception("Unexpected number of parts in time: " + time)
  # validate month
  months = {"Jan":"01", "Feb":"02", "Mar":"03", "Apr": "04", 
            "May":"05", "Jun":"06", "Jul":"07", "Aug":"08", 
            "Sep":"09", "Oct":"10", "Nov":"11", "Dec":"12"}
  if time_parts[0] in months:
    time_parts[0] = months.get(time_parts[0])
  else:
    raise Exception("Unexpected format when translating month " + 
                    time_parts[0] + " of time: " + time)
  # time_parts[1] should be a number representing the day.
  try:
    int(time_parts[1])
  except ValueError:
    raise Exception("Unexpected format when translating day " + 
                    time_parts[1] + " of time: " + time)
  else:
    # if day is less than 10 prepend a 0.
    if int(time_parts[1]) < 10:
      time_parts[1] = "0" + time_parts[1]
  # validate hour:minute:second
  hour_minute_second = time_parts[2].split(":")
  if (len(hour_minute_second) != 3 or not 
      hour_minute_second[0].isdigit() or not
      hour_minute_second[1].isdigit() or not
      hour_minute_second[2].isdigit()):
    raise Exception("Unexpected format when translating "
                    "hour:minute:second " + time_parts[2] + 
                    " of time: " + time)
  # time_parts[4] should be a number representing the year.
  try:
    int(time_parts[4])
  except ValueError:
    raise Exception("Unexpected format when translating year " + 
                    time_parts[4] + " of time: " + time)
  return (time_parts[4] + "/" + time_parts[0] + "/" + time_parts[1] +
         "-" + time_parts[2])