from datetime import datetime
import time


def datetime2timestamp(date : datetime):
    """
    Convert datetime to unix timestamp
    :param date: Date to be converted in a unix timestamp
    :type date: datetime
    
    :return: Unix timestamp
    :rtype: int
    """
    return int(time.mktime(date.timetuple()))