2008-03-24

Python date测试

关键字: datetime
import datetime, calendar today = datetime.date.today() oneday = datetime.timedelta(days=1) # loop back to most recent Friday (could be today) # takes care of end of month and even leap years friday = today while friday.weekday() != calendar.FRIDAY: friday -=oneday oneweek = datetim ...