In article <11**********************@v46g2000cwv.googlegroups .com>,
"Thierry Lam" <la********@gmail.com> 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 - timedelta(1)
# See the .month, .day, and .year fields of yesterday
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA