Use "localtime" in clean_date_for_sort, which is more likely to be what the user is really looking at. Continue to use non-naive dates so that differences in DST are taken into account.

This commit is contained in:
Charles Haley 2011-11-18 13:09:45 +01:00
parent 71b59c4a1b
commit 25ab93133d

View File

@ -291,6 +291,11 @@ def clean_date_for_sort(dt, format):
if not isinstance(dt, datetime):
dt = datetime.combine(dt, time())
if hasattr(dt, 'tzinfo'):
if dt.tzinfo is None:
dt = dt.replace(tzinfo=_local_tz)
dt = as_local_time(dt)
if format == 'iso':
format = 'yyMdhms'