>>> import time
>>> time.asctime(time.strptime('2008 50 1', '%Y %W %w'))
'Mon Dec 15 00:00:00 2008'
Assuming the first day of your week is Monday, use %U
instead of %W
if the first day of your week is Sunday. See the documentation for strptime for details.
Update: Fixed week number. The %W
directive is 0-based so week 51 would be entered as 50, not 51.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…