9 lines
193 B
Python
9 lines
193 B
Python
import datetime
|
|
|
|
# 获取当前日期时间
|
|
now = datetime.datetime.now()
|
|
|
|
# 使用 isocalendar() 获取当前周数
|
|
week_number = now.isocalendar()[1]
|
|
|
|
print(f"当前是第 {week_number} 周") |