python获取今天00:00:00的时间戳

import datetime
import time

today_date = datetime.date.today()
today_str = today_date.strftime("%Y-%m-%d")
yestoday_date = today_date - datetime.timedelta(days=1)
yestoday_str = yestoday_date.strftime("%Y-%m-%d")

today_stamp = time.mktime(time.strptime(today_str + ' 00:00:00', '%Y-%m-%d %H:%M:%S'))
yestoday_stamp = time.mktime(time.strptime(yestoday_str + ' 00:00:00', '%Y-%m-%d %H:%M:%S'))

你可能感兴趣的:(python)