According to MSDN "Rounding of datetime Fractional Second Precision" it should truncate the following Date when saving into a datetime column:
new DateTime(635180453197748530L) //22 October 2013 13:28:39.7748530
// write to SQL server and re-read it
// result should be = 6351804531977 3 0000L
However, it is reproducible 6351804531977 7 0000L. Is this a bug or do I have any problems in my understanding of the algorithm?
(we use Entity Framework for read/write to DB)
Sometimes before I write a datetime to the database, I cast it to SqlDateTime, which I have found produces much more predictable results with regards to rounding/truncation than simply writing the CLR datatype to the database directly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With