json.dumps(log_list,default=utils.json_datetime_handler)

import time,hashlib,json
import models
from django.shortcuts import render,HttpResponse
from MadKing import settings

from django.core.exceptions import ObjectDoesNotExist
def json_date_handler(obj):
    if hasattr(obj, 'isoformat'):
        return obj.strftime("%Y-%m-%d")


def json_datetime_handler(obj):
    if hasattr(obj, 'isoformat'):
        return obj.strftime("%Y-%m-%d %H:%M:%S")

 

相关文章:

  • 2022-02-20
  • 2022-12-23
  • 2021-07-16
  • 2021-12-03
  • 2022-12-23
  • 2021-08-16
  • 2021-06-09
  • 2021-12-03
猜你喜欢
  • 2021-11-10
  • 2021-06-08
  • 2021-08-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案