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

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -