In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Recently, when I looked at Flask, there was a requirement to use Flask to make a custom api call to a project. I saw that there was an error when running the code here in the database:
Check the date field in table, and it is in date format, that's right:
Field information of table:
So I looked it up on the Internet and said that there is a difference between Python's datetime and sqlite's datetime. The storage format of datetime in sqlite is: yyyy-mm-dd hh:mm:ss.
The format of datetime I inserted into table was yyyy/mm/dd hh:mm:ss, so I inserted a few more pieces of data in the format of sqlite, yyyy-mm-dd hh:mm:ss. As you can see in the following figure, there are two types of data formats.
Re-visit api, this time to visit the data with the correct date format, that's right.
In fact, a better solution is to insert data, if not the default date format of sqlite, plus a date format conversion, to solve this problem. You can try it sometime. I hope this blog can help friends who encounter the same problems.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 263
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.