Having a look on my CRM Bible (SDK), i have found a Enumeration to Round Dates to: Day, Hour, Minute, Second and Month. So, i had to test that.
Always good to know this things, instead of doing extra lines of code or using other libraries for this, why not using default capabilities of CRM dlls.
DateTime dt = Microsoft.Xrm.Client.DateTimeExtensions.Round(DateTime.Now, Microsoft.Xrm.Client.RoundTo.Day);
Result will be:{15/04/2015 00:00:00}
Comentarios