Support microsecond precision in MySQL ORM DateTimeField
|Reported by:||erik@…||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
MariaDB, and MySQL 5.6, support sub-second precision in DATETIME fields (see https://kb.askmonty.org/en/microseconds-in-mariadb/).
Ideally, the ORM should support storing and retrieving datetime() with microsecond precision and creating DATETIME(n) columns.
I tested a models.DateTimeField() field backed by DATETIME(3) on MariaDB, but unfortunately the field on the Django model instance is always None even though the database contains a valid date.
Change History (21)
comment:1 Changed 3 years ago by carljm
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
Changed 18 months ago by claudep
comment:18 Changed 11 months ago by timgraham
- Triage Stage changed from Accepted to Ready for checkin