@register.filter(name='unix_to_datetime')
def unix_to_datetime(unixtime):
 return datetime.datetime.fromtimestamp(unixtime)

@ register . filter ( name = 'unix_to_datetime' ) def unix_to_datetime ( unixtime ) : return datetime . datetime . fromtimestamp ( unixtime )
unixtime is seconds since the epoch .