# models.py
update_time = models.DateTimeField(verbose_name=u'更新时间', default=timezone.now)
问题:天 与 小时的中间带 T
"gmt_created": "2019-05-19T22:47:46.853262"
解决方法:
# serializers.py
class DeviceSerialiser(ModelSerializer):
# 设置日期格式化格式
update_time = serializers.DateTimeField(format='%Y-%m-%d %H:%M:%S')
class Meta:
model = WaterDevice
fields = ('__all__')