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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pradeep ShetRank #595 · 4K reputationPosted Jan 29, 2015, 10:05 PM EST
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.
Abc Thakur182 reputationPosted Jan 29, 2015, 10:09 PM EST