Hi,
I have a string variable which has a date value and I am trying to set the datetime field.
This way:
string requestDate = (string)rowItem["Request Date"].ToString();
DateTime dt = Convert.ToDateTime(requestDate);
incident.Attributes["new_requestdate"] = dt;
This works fine if I have just the date value.. ex: rowItem["Request Date"]=9/20/2015
It is setting the field with default timestamp as 12:00:00 AM. No issues with this.
But it throws error when rowItem["Request Date"]= 9/14/2015 9:03:46 AM
How do I convert the string variable that is in two different formats and set them into datetime field?
Thanks for any help!
*This post is locked for comments
I have the same question (0)