mqtt
This commit is contained in:
parent
09350f0357
commit
35508548ee
4
tool.py
4
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
|
||||
|
|
Loading…
Reference in New Issue