Re: Finding yesterday's date with datetime

2006-05-15 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, "Thierry Lam" <[EMAIL PROTECTED]> wrote: > Is there an easy way to determine the yesterday's date(year-month-day) > from the python datetime library if I know today's date? from datetime import datetime, timedelta today = datetime.today() yesterday = today - time

Re: Finding yesterday's date with datetime

2006-05-15 Thread [EMAIL PROTECTED]
Try something like this... HTH. A. from datetime import * d1 = datetime( year=2006, month=5, day=15) d2 = datetime.now() for d in [d1,d2]: yest = d - timedelta(days =1 ) print "%s -> %s" % (d, yest) -- http://mail.python.org/mailman/listinfo/python-list

Finding yesterday's date with datetime

2006-05-15 Thread Thierry Lam
Is there an easy way to determine the yesterday's date(year-month-day) from the python datetime library if I know today's date? Thanks Thierry -- http://mail.python.org/mailman/listinfo/python-list