from datetime import datetime


def epoch_to_str(epoch, fmt='%Y-%m-%d %H:%M:%S'):
    """
    Convert a unix timestamp into date string

    :param epoch: unix timestamp
    :param fmt: date format
    :return: formatted date from timestamp
    """
    return datetime.fromtimestamp(epoch).strftime(fmt)