# coding: utf-8
import time
import datetime


def datetime2timestamp(dt):
    return int(time.mktime(dt.timetuple()))


def strtime2datetime(stringDate):
    return datetime.datetime.fromtimestamp(time.mktime(time.strptime(stringDate, "%Y-%m-%d %H:%M:%S")))