diff --git a/test.py b/test.py index b0796e6..349e911 100644 --- a/test.py +++ b/test.py @@ -10,12 +10,11 @@ def list_files_with_times(root_folder): # 获取文件的最后修改时间 modification_time = os.path.getmtime(file_path) # 格式化时间 - # formatted_time = datetime.fromtimestamp(modification_time).strftime('%Y-%m-%d %H:%M:%S') + formatted_time = datetime.fromtimestamp(modification_time).strftime('%Y-%m-%d %H:%M:%S') remove_time = datetime.fromtimestamp(modification_time).strftime('%Y-%m-%d') if remove_time == "2024-10-28": - formatted_time = datetime.fromtimestamp(modification_time).strftime('%Y-%m-%d %H:%M:%S') os.remove(file_path) - print(f"File: {file_path} | Last Modified: {formatted_time}") + print(f"File: {file_path} | Last Modified: {formatted_time}") # 使用示例 root_folder = os.path.join(BASE_OUTPUT, 'CBZ/') # 替换为实际文件夹路径