@register.filter<EOL>def to_localtime(time):
utc_time = time.replace(tzinfo=timezone.utc)<EOL>to_zone = timezone.get_default_timezone()<EOL>return utc_time.astimezone(to_zone)<EOL>
Converts naive datetime to localtime based on settings