Fractional DateTimeField values
See original GitHub issueThe fractional part of a datetime
object seems to be always truncated. Looking through the code a bit, I also see that it doesn’t expect there to be one: https://github.com/coleifer/peewee/blob/master/peewee.py#L204
I assume this is primarily cause not all databases support fractional seconds (older versions of MySQL, for instance). Is there a way to optionally support it if the database underneath supports it?
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
11.2.6 Fractional Seconds in Time Values
MySQL has fractional seconds support for TIME , DATETIME , and TIMESTAMP values, with up to microseconds (6 digits) precision:.
Read more >Datetime values - IBM
A timestamp is a six or seven-part value (year, month, day, hour, minute, second, and optional fractions of a second) designating a date...
Read more >Django datetime field fractional support - Stack Overflow
I was using the MySQL 5.5 without fractional support but there are records in my database that have the same datetime field and...
Read more >How to Return Fractional Seconds from a Datetime Value in ...
To return the fractional seconds part from a datetime value, use the FF format element. Example. Here's an example to demonstrate: SELECT ...
Read more >Why are fractional seconds in date/time values truncated in ...
do not support fractional seconds. While. "myDateField DATETIME(6)". does supports fractional seconds up to micro seconds. See: https://dev.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After read the information you provided, I got this, and it seems work:
@luisulloa IIUC, not all MySql versions support this