[Answered ]-Django autoconversion of strings to datetimes

2πŸ‘

βœ…

SQLite does not have a storage class set aside for storing dates
and/or times. Instead, the built-in Date And Time Functions of SQLite
are capable of storing dates and times as TEXT, REAL, or INTEGER
values

https://www.sqlite.org/datatype3.html#section_2_2

Thus this behavior is very different from PostgreSQL and mysql both of which happen to have separate data types for date, time and datetimes.

So the answer to β€œIs this behavior consistent across all Django database backends?” is no

β€œWhere is this documented?” refer above link

β€œAlso, how do I determine if a datetime in string form that I have received from an external source (not a Django form) will be valid with Django’s database?” It depends. If you have trouble with specific dates and times received from external sources, I would suggest a separate question on it.

πŸ‘€e4c5

Leave a comment