Populating MySQL datetime column in Python -
i'm having little trouble populating mysql datetime colum python using sql alchemy , flask app manager.
this definition of column in model class.
expired = column(datetime)
this code populating , saving accesstoken record.
accesstoken = db.session.query(accesstoken).filter_by(token=accesscode).first() if (accesstoken): accesstoken.expired = datetime.datetime.now() db.session.commit()
the value in expired 127 no matter when record saved. from_unixtime(expired)
returning '1969-12-31 16:02:07' no matter when record saved.
what doing wrong? thanks!
Comments
Post a Comment