When converting to/from CrmDateTime in C# key is the “Value” attribute. We can simply read it and also assign it.
CrmDateTime to DateTime
DateTime _datetime = Convert.ToDateTime(dateTime.Value)
DateTime to CrmDateTime
CrmDateTime _crmDataTime = new CrmDateTime(); _crmDataTime.Value = _datetime.ToString("s");
Also, we can modify date time related other attributes this way.
No comments:
Post a Comment