def timeformat(data): try: return data.strftime(settings.TIME_FORMAT) # print(data.strftime(settings.TIME_FORMAT)) # return "ddd" except: return ""