def print_timestamp(timestamp):
try:
#assume, that timestamp is given in seconds with decimal point
ts = float(timestamp)
except ValueError:
return None
return datetime.datetime.fromtimestamp(ts).strftime(settings.EVENT_DATE_FORMAT)
评论列表
文章目录