Skip to main content

Notifications

Dynamics 365 Community / Blogs / Dynamics Monster / CRM 2015 - Microsoft.Xrm.Cl...

CRM 2015 - Microsoft.Xrm.Client DLL - Round DateTime To

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}

Comments

*This post is locked for comments