标签:
if (item.from_datetime.replace(tzinfo=None) >= datetime.datetime.now()):
Django默认支持多时区;
dt = datetime.datetime(2015, 4, 9, 11, 2, 52,
tzinfo
=
<LocalTimezone>
) : offset-aware
now
=
datetime.datetime.now() : offset-naive
dt
=
dt.replace(tzinfo
=
None
)
can‘t compare offset-naive and offset-aware
标签:
原文地址:http://my.oschina.net/u/2002748/blog/397757