From 35508548ee8b89337cd61d49cb00544760865a9c Mon Sep 17 00:00:00 2001 From: xyj <10908227994@qq.com> Date: Sat, 2 Dec 2023 19:51:55 +0800 Subject: [PATCH] mqtt --- tool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool.py b/tool.py index efaa3a2..4b21148 100644 --- a/tool.py +++ b/tool.py @@ -31,7 +31,7 @@ def get_record(msg, client): create_time_time_str = create_time.split(' ')[1] create_time_ = datetime.datetime(int(create_time_date_str[:4]), int(create_time_date_str[5:7]), int(create_time_date_str[8:10]), int(create_time_time_str[:2]), - int(create_time_time_str[3:5]), int(create_time_time_str[6:8])) + int(create_time_time_str[3:5])) file_name_ = '' for filename in os.listdir('mp4'): # 检查文件名是否符合格式 %Y-%m-%d_%H-%M-%S @@ -43,7 +43,7 @@ def get_record(msg, client): # 将日期和时间字符串转换为 datetime 对象 file_time = datetime.datetime(int(date_str[:4]), int(date_str[5:7]), int(date_str[8:10]), int(time_str[:2]), - int(time_str[3:5]), int(time_str[6:8])) + int(time_str[3:5])) # 比较文件时间和创建时间 if file_time > create_time_: file_name_ = filename