I\'m having an issue with saving and retrieving dates with Mongo using the c# driver. For some reason it it\'s truncating the ticks.
When I store this:
Here's an extension you could use :)
public static class MongoDateComparison
{
private static int precisionInMilliseconds = 1000;
public static bool MongoEquals(this DateTime dateTime, DateTime mongoDateTime)
{
return Math.Abs((dateTime - mongoDateTime).TotalMilliseconds) < precisionInMilliseconds;
}
}