Soumya Ps

Soumya Ps

  • NA
  • 148
  • 17.4k

Date Conversion

Apr 7 2018 12:36 AM
I have date in this format
 
string strdob =Convert.ToDateTime(ddlDay.SelectedValue + "-" + ddlMonth.SelectedValue + "-" + ddlYear.SelectedValue).ToString("yyyy-MM-dd");
 
Output is like "2017-03-06"
 
In my database i stored date as  {2017-03-06 00:00:00}
 
I used this ,,DateTime DOBDate = DateTime.Parse(strdob); 
 but the Result Shows like {06-03-2017 00:00:00}
 
I want to display it as  {2017-03-06 00:00:00}.How can i do it??
 

Answers (5)