def inttodate(i, lim=1965, unknown='U', sep='-', order="asc", startsatyear=0):
    """
    transforms an int representing days into a date

    Args:
      i: the int
      lim: the limited year below which we have a mistake
      unknown: what to return when unknown (date is bellow the limited year)
      sep: the sep between your date (e.g. /, -, ...)
      order: if 'asc', do d,m,y else do y,m,d
      startsatyear: when is the year to start counting for this int

    Returns:
      str: the date or unknown
    """
    a = int(i // 365)
    if a > lim:
        a = str(a + startsatyear)
        r = i % 365
        m = str(int(r // 32)) if int(r // 32) > 0 else str(1)
        r = r % 32
        d = str(int(r)) if int(r) > 0 else str(1)
    else:
        return unknown
    return d + sep + m + sep + a if order == "asc" else a + sep + m + sep + d