B
B.N.Prabhu
hi,
I am having a DataTable which one column is in string format now i want to
change that one to DataTime. I don't know whether its in datetime format or
not i have to check if it is in DateTime Format some times it may in normal
string not a DateTime. If it is in any one of the DateTime format then i have
to change it as a Specfic format as "21-03-2005 11:34" using C#.Net.
If its not in DateTime format then i should give a message.
txt3.Text = txt3.Text.Replace("AM","");
txt3.Text = txt3.Text.Replace("PM","");
string strDateTime = txt3.Text.Trim();
DateTime dtConvert = DateTime.Parse(strDateTime);
// Format to 14-05-2006
string strConvert = dtConvert.ToString("dd-MM-yyyy");
I used this type but i am getting error as "String is not in a correct format"
I don't know what to do. any one please help.
I am having a DataTable which one column is in string format now i want to
change that one to DataTime. I don't know whether its in datetime format or
not i have to check if it is in DateTime Format some times it may in normal
string not a DateTime. If it is in any one of the DateTime format then i have
to change it as a Specfic format as "21-03-2005 11:34" using C#.Net.
If its not in DateTime format then i should give a message.
txt3.Text = txt3.Text.Replace("AM","");
txt3.Text = txt3.Text.Replace("PM","");
string strDateTime = txt3.Text.Trim();
DateTime dtConvert = DateTime.Parse(strDateTime);
// Format to 14-05-2006
string strConvert = dtConvert.ToString("dd-MM-yyyy");
I used this type but i am getting error as "String is not in a correct format"
I don't know what to do. any one please help.