Skip to content Skip to sidebar Skip to footer

Python Sqlite Valueerror: Couldn't Parse Datetime String

I have a .txt file which I use to fill a sqlite table FoodConsumed_tb class FoodConsumed_Tb(db.Model): __tablename__ = 'foodconsumed_tb' id = db.Column(db.Integer, primary

Solution 1:

this is format error.

  1. your date type is 'date_created = db.Column(db.DateTime)', you should insert value 'datetime('now')'

  2. if your data type is 'db.Column(db.Date)', then the value should be 'date('now')'

datetime ->2020-04-0214:30:21
date ->2020-04-02

Post a Comment for "Python Sqlite Valueerror: Couldn't Parse Datetime String"