Given a particular date, say 2011-07-02, how can I find the date of the next Monday (or any weekday day for that matter) after that date?
import datetime d = datetime.date(2011, 7, 2) while d.weekday() != 0: d += datetime.timedelta(1)