how to convert string
year to DateTime
format ?
my code :
// click button
string a = "2014";
DateTime b = DateTime.Parse(a);
MessageBox.Show(b.ToString());
You can try something like this
var year = int.Parse("2014");
DateTime dateTime = new DateTime(year, 1, 1);
Console.WriteLine(dateTime.ToString());