Monday, October 3, 2011

CRM 2011 - Day Light Issue-Convert Date Time C# Code

Get DaylightChanges hours in CurrentTimeZone and add it to the Date.
//CurentDate Date Time Save in the CRM
TimeZone localZone = TimeZone.CurrentTimeZone;
DaylightTime hours= localZone.GetDaylightChanges ( CurentDate.Year );
CurentDate = CurentDate.AddHours ( hours.Delta.Hours );

No comments:

Post a Comment