import time


def isoformat(seconds=None, format="%Y-%m-%d %H:%M:%SZ"):
    """
    Return the ISO 8601 formatted timestamp based on the time
    expressed in seconds since the epoch. Use time.time() if seconds
    is not given or None.

    >>> isoformat(0)
    '1970-01-01 00:00:00Z'
    """

    return time.strftime(format, time.gmtime(seconds))