Istudent Rana

Istudent Rana

  • 1.4k
  • 344
  • 84.2k

How do i convert string date from xml to date time data type

Apr 26 2019 1:40 PM
My xml file:
 
<?xml version="1.0" encoding="UTF-8"?>
<Student>
<Name>John</Name>
<Grade>5</Grade>
<BirthDate>01/08/2009 15:00:00</BirthDate>
</Student>
 
My object:
 
public class Student
{
public string Name { get; set; }

public DateTime BirthDate{ get; set; }

public int Grade { get; set; }
}
 

Answers (3)