获取秒数:

import time
timestamp = time.time()

根据秒数创建 datetime.date 对象:

import datetime
datetime.date =datetime.date.fromtimestamp(timestamp)

datetime.date 对象确定当前是第几周:

(year, week, day) = datetime.date.isocalendar()
Comments
Write a Comment