Some time we need to set crmdatetime based on input value for year,month,date so we can create datatime variable in .net as
DateTime _DateTime=new DateTime(2010,4,15);
so it will result like “4/15/2010 00:00:00”
But if you will try to assign this value to crmdatetime like
CrmDateTime _CrmDateTime = new CrmDateTime();
you will get a date-time format exception in crm As CrmDateTime class expects the date in a certain format. like below
So you have to assign this value to crmdatetime like below
Good luck !!!!