def to_unix_epoch_time(dt):

    if type(dt) == Date:
        return (dt - UNIX_EPOCH.date()).total_seconds() * 1000
    return int((dt - UNIX_EPOCH).total_seconds() * 1000)
Convert either `datetime.date or datetime.datetime objects
dataset/ETHPy150Open Sage-Bionetworks/synapsePythonClient/synapseclient/utils.py/to_unix_epoch_time