Closed gjvanvuuren closed 2 years ago
https://www.litedb.org/docs/data-structure/.
Following the BSON specification, DateTime values are stored only up to the miliseconds. All DateTime values are converted to UTC on storage and converted back to local time on retrieval.
OK. Strange limitation, but OK. I see on other sites that the solution is:
You need to store the date as a string in MongoDB if you want the full precision.
I'll have to go with that.
You could store it as binary instead!
Version 5.0.12
Describe the bug In the following constructor:
the
Truncate()
statement creates a new DateTime by using the Year, Month, Day, Hour, Minutes, Seconds, Milliseconds properties. This causes the microseconds and nanoseconds to be dropped.Code to Reproduce
Expected behavior The underlying structure of DateTime should not change, as reflected by the ticks, and/or the round-trip date/time pattern ("o").
Additional context Especially in the context of IOT devices, the accuracy provided by microseconds become important. The easiest solution to this problem would be to not create a new DateTime object in the constructor.