I don't seem to understand how I'm supposed to use Python's datetime.timedelta function to calculate tomorrow's date.
Example:
from datetime import datetime, timedelta
print(datetime.now())
print( datetime.now() + timedelta(hours=24))
Outputs:
2015-02-22 14:51:11.515000
2015-02-23 05:18:30.728056
But the second line should be more like:
2015-02-23 14:51:11
You can see this in action here.
UPDATE Thanks everyone for your comments! Apparently timedelta
is broken on Python 2.7.2 [1] – would be nice to find out in which version this was fixed, though.
[1] Thanks to J.F. Sebastian for pointing out that I was wrong: timedelta
is broken on Repl.it's Empythoned