Why I'm getting the date of yesterday

Hussein B hubaghdadi at gmail.com
Tue Jan 20 08:11:17 EST 2009


Hey,
I'm trying to get the get the date before today, I tried this:
d = datetime.now() - timedelta(days = -1)
But I got the date of tomorrow.
when I tried:
d = datetime.now() + timedelta(days = -1)
I got the date of yesterday.
Would you please explain to me why I got the date of yesterday when I
added the both objects?
Thanks.




More information about the Python-list mailing list