I have an xml which I am reading in a date:
<DateOfBirthUpdate> <DateOfBirth>1951-04-25</DateOfBirth> </DateOfBirthUpdate>
My code reads this in as 25/4/1951 00:00:00 but I need to convert it back to it's original format of 1951-04-25 so it can be used in a soap message.
dateOfBirthUpdate.DateOfBirth = Convert.ToDateTime(record.Element("DateOfBirthUpdate").Element("DateOfBirth").Value); inUpdate.DateOfBirthUpdate = dateOfBirthUpdate;
I have tried various methods but nothing seems to work.
Many thanks inadvance..