def date_to_timestamp(date):
"""
Args:
date: Date as string with these formats: "Y-m-d", "Y-m-d H-M-S".
Returns:
"""
# format input string if only date but no time is provided
if len(date) == 10:
date = "{} 00:00:00".format(date)
return time.mktime(time.strptime(date, '%Y-%m-%d %H:%M:%S')) #
评论列表
文章目录