1/30/2015 , 12:59:04 PM
How to split Date into text box and time in 4 dropdown list
like date
1/30/2015
time
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abc ThakurPosted Jan 30, 2015, 3:09 AM
Pradeep ShetPosted Jan 30, 2015, 3:05 AM
If you have values 1/30/2015 , 12:59:04 PM as provided. Then showing Date in a textbox seems to be easy.
string dttime = "1/30/2015 , 12:59:04 PM";
string[] splitDate_time = dttime.Split(new char[]{','});
string timeZone = dttime.Right(2); //It will give PM;
string[] splitTime = dplitDate_time[1].Trim().TrimEnd("PM").Split(new char[]{':'});
txtDate.Text = dplitDate_time[0];
Hope this is what you were expecting. Mark it as answered if it helped you.