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
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
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