I have a variable openDate
which holds date and time, and I would like to strip just the date. I tried the below example and it is not working. What am I doing wrong, or rather how should I do it because the variable openDate
remains the same even after trying to strip just the date? The value of openDate
is "2012-03-08 00:00:00"
openDate = ! string.IsNullOrEmpty(node.ChildNodes[f].Attributes["ows_PMO_x0020_Origination_x0020_Date"].Value)
? node.ChildNodes[f].Attributes["ows_PMO_x0020_Origination_x0020_Date"].Value
: "" ;
openDate = String.Format("{0:MM/dd/yyyy}", openDate);