Issue
I am wondering how can I change the default time output in flask
mysql property is as below
created_at = db.Column(db.DateTime, nullable=False, default=datetime.now)
for this I get output on html as - 2022-08-05 13:27:09.208330
how can I change this into 2022-08-05 13:27
I tried adding strftime but it doesn't support
Solution
I think you can encapsulate a function, return the time in this format, and then replace it datetime.now
Because he is calling this function for you
Answered By - Recar
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.