Split Datetime and Fill in the ComboBox in C#.net

Naraayanan
Posted by Naraayanan under C# category on | Points: 40 | Views : 6982
  dte = DateTime.Today;
string str = Convert.ToString(dte);
string [] sr = str.Split(' ' );
string fvalue = sr[0];
string[] splitdate = fvalue.Split ('/');
string mnt = splitdate[0];
string day = splitdate[1];
string year = splitdate[2];

comboBox1.Text = day;
comboBox2.Text = mnt;
comboBox3.Text = year;

Comments or Responses

Login to post response