I noticed that 2 datetimes are considered equal if one is
2010-12-31 15:13:48.000
and the other
2010-12-31 15:13:48.001.
I thought in the beginning that it was rounding up or down to nearest full seconds but it turned out
2010-12-31 15:13:48.002
registers the difference correctly.
Any idea why this happens?
The datetime data type is accurate to 3 milliseconds (0.0033 seconds), so your results make sense. Values are rounded to 0.000, 0.003, and 0.007. So, your first example is rounded to: "2010-12-31 15:13:48.000" and the second to "2010-12-31 15:13:48.003".
You can read about this in the documentation.
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