All pastes #732362 Raw Edit

Something

public text v1 · immutable
·published 2007-10-10 22:10 UTC
rendered paste body
def mondayPlus(inc=0):
            """return a m/d/yy date string equal to this Monday plus inc days"""
            today = datetime.date.today()
            daysUntilMonday = today.weekday()
            if daysUntilMonday == 6: daysUntilMonday = -1 #sunday is special case
            monday = today - datetime.timedelta(days=daysUntilMonday)
            incDay =  monday + datetime.timedelta(days=inc)
            y, m, d = incDay.timetuple()[:3]
            return '%s/%s/%s' % (m, d, y)
    

        evtDate = mondayPlus()
        evtSecondDate = mondayPlus(1)
        evtThirdDate = mondayPlus(2)
        evtRecurrenceEnd = mondayPlus(365)
        evtNextWeek = mondayPlus(7)