分页: 1 / 1

[python] time相关

发表于 : 2025年 3月 18日 11:59
rxxx
[python] time相关

代码: 全选

```
from datetime import datetime

nowtime = datetime.today().strftime('%Y%m%d')
new_url = datetime.today().strftime('https://a.nodeshare.xyz/uploads/%Y/%-m/%Y%m%d.txt')    #%-m 显示1位数的月份,如%m = 01月,%-m = 1月
nowtime = datetime.now()
song_id = nowtime.weekday() #周几,0是周1
if nowtime.hour > 20:#晚20点后
if nowtime.day%2 == 0   #隔一天
```