import zipfile


def _format_toc(filename):
    """Return a table of contents for the zip file as a string.

    Args:
        filename (str): Path to zip file

    Returns: directory listed in format matching zipfile.printdir()
    """
    zf = zipfile.ZipFile(filename)
    lines = []
    lines.append("%-46s %19s %12s" % ("File Name", "Modified    ", "Size"))
    for zinfo in zf.filelist:
        date = "%d-%02d-%02d %02d:%02d:%02d" % zinfo.date_time[:6]
        lines.append("%-46s %s %12d" % (zinfo.filename, date, zinfo.file_size))
    return lines