from django.utils import timezone
import datetime
timezone.now()
datetime.datetime(2014, 7, 18, 9, 42, 24, 531000, tzinfo=<UTC>)
timezone.now() -datetime.timedelta(days=1)
2014-07-17 09:42:05.968000+00:00
print timezone.now() + datetime.timedelta(days=1)
2014-07-19 09:42:33.500000+00:00
timezone.now() - datetime.timedelta(days=5)
2014-07-13 09:43:02.140000+00:00
timezone.now() - datetime.timedelta(hours=5)
2014-07-18 04:45:17.859000+00:00
datetime.timedelta,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/tuifeideyouran/p/3854035.html