import time


def datetime_to_stamp(date_time):
    """
    将字符串日期格式转换为时间戳  2018-10-09 16:00:00==>1539100800
    :param date_time:
    :return:
    """
    # 字符类型的时间
    time_array = time.strptime(date_time, "%Y-%m-%d %H:%M:%S")
    time_stamp = int(time.mktime(time_array))
    return time_stamp