测试功能
from django.utils import timezone
def date_diff_now(date):
print(date)
print(timezone.now())
print(date - timezone.now())
print((date - timezone.now()).days)
结果
2018-02-07 17:46:36.442314+00:00
2018-02-07 17:47:32.084900+00:00
-1 day, 23:59:04.357374
-1
为什么同一天 2 个日期时间之间的差异不返回 0 ?