In my application, I am assigning DateTime.Now to a new DateTime. then I assign it to the value and write it to the database. But then, when I return from the database and compare the variable with the new date assigned earlier, it differs from a couple of milliseconds.
Does anyone have an idea why this is happening?
eg.
DateTime var1 = DateTime.Now; Object1.DateTime = var1; Database.SaveObject = var1 Object2 = Database.FindObjectById(objectId); Assert.AreEqual(var1, Object2.DateTime);
source share