@register.filter(name='unix_ms_to_datetime')
def unix_ms_to_datetime(unixtime):
 if unixtime:
  return datetime.datetime.fromtimestamp((unixtime / 1000))
 return _('No time')

@ register . filter ( name = 'unix_ms_to_datetime' ) def unix_ms_to_datetime ( unixtime ) : if unixtime : return datetime . datetime . fromtimestamp ( ( unixtime / 1000 ) ) return _ ( 'No time' )
unixtime is seconds since the epoch .