from datetime import datetime


def cid_to_date(cid):
    """Converts a cid to date string YYYY-MM-DD

    Parameters
    ----------
    cid : int
        A cid as it is generated by the function ``utils.create_cid()``

    Returns
    -------
    str
        A string formated date (e.g. YYYY-MM-DD, 2018-10-01)
    """
    return datetime.utcfromtimestamp(
        cid/10000000.0
    ).strftime("%Y-%m-%d")