学习Django时,给模型定义了DateField类型字段
数据迁移以后,打开db.sqlite3数据库,手动添加日期数据,提交后变成长整数的形式
提交前:
提交后:
解决方法:SQLite DateTime field incorrect format
**
- tips:更改完成后刷新数据库,重新打开表才会生效
**
完成后提交,发现日期末尾又会自动增加时分秒的格式(00:00:00.000)
解决方法同理:Is there a way to set the default date format for queries and results?
更改完成后记得刷新数据库
成功提交: