摘要: 正序 time1 = details.objects.all().order_by('time') 倒序 time2 = details.objects.all().order_by('-time') 阅读全文
posted @ 2020-05-09 11:39 Edison、23 阅读(2152) 评论(0) 推荐(0) 编辑
摘要: 1. 导入time模块 import time 2. 获取现在时间,使用"年-月-日 时:分:秒"这样的模板,赋值给变量 在views.py中: pt = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())) 3.写入数据库 d 阅读全文
posted @ 2020-05-09 11:26 Edison、23 阅读(936) 评论(0) 推荐(0) 编辑