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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -