Skip to content

Commit

Permalink
*
Browse files Browse the repository at this point in the history
  • Loading branch information
JingHai-Lingyun committed Apr 23, 2024
1 parent b9dac21 commit d9f70f9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

# 本期更新内容

#### (更新时间:2024-03-25 03:43:22
#### (更新时间:2024-04-23 10:20:04

1:完成 [20240323](https://github.com/WForst-Breeze/PCL2-1930/commits/form/?since=2024-03-23&until=2024-03-25) 内容同步
1:合并 PR #23,感谢 @wuyuncheng-26 的贡献

</div>

Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ <h1><img src="static/img/book.png"> <content>预设主页</content></h1>
<br>
<div id="updateLog">
<h5>
本页作者 <a class="ghAt">@JingHai-Lingyun</a>,有问题/更新不及时请到 <a href="https://github.com/lingyunawa/pcl-doc/issues">Github</a> 提交反馈&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;最近更新时间:2024-03-25 03:43:22
本页作者 <a class="ghAt">@JingHai-Lingyun</a>,有问题/更新不及时请到 <a href="https://github.com/lingyunawa/pcl-doc/issues">Github</a> 提交反馈&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;最近更新时间:2024-04-23 10:20:04
<br><br>
感谢 <a class="ghAt">@Deep-Dark-Forest</a> 给本文做出的贡献
</h5>
Expand Down
4 changes: 2 additions & 2 deletions update-time-gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
from datetime import datetime

def replace_time(file_path):
# 1. 读取 index.html 文件内容
# 1. 读取文件内容
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()
# 2. 查找并替换时间部分
pattern = r'更新时间:\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}'
current_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
updated_content = re.sub(pattern, f'更新时间:{current_time}', content, count=1)
# 3. 将更新后的内容写回到 index.html 文件
# 3. 将更新后的内容回写到文件
with open(file_path, 'w', encoding='utf-8') as file:
file.write(updated_content)
print(f'Replace time "{current_time}" in file "{file_path}" done')
Expand Down

0 comments on commit d9f70f9

Please sign in to comment.