mike Delvotti

mike Delvotti

  • NA
  • 262
  • 0

Pass datetime string from xml

Nov 23 2012 11:07 AM
what would be the best way to pass the time value stored in an xml element into a datetime picker?

for instance, the below line throws an error as it doesn't like the format:

dateTimePicker1.Value = DateTime.ParseExact(person.Date, "HH:mm", null);
(person.date is my xml element it's reading from) the time is stored in the element as such: HH:mm

Answers (5)