This is the time picker which takes time in AM PM format for 1-12 hours. Now I am confused on how to convert this format to sql datetime format ...
I have used this :
var date = string.Format("{0:yyyy-MM-dd HH:mm tt}", DateTime.Parse("11:59 PM"));
ScriptManager.RegisterStartupScript(Page, GetType(), UniqueID, "ShowPopup('" + date + "');", true);
It works fine or hard coded value but when i do this :
string a = STBox.Value.Trim();
var date = string.Format("{0:yyyy-MM-dd HH:mm tt}", DateTime.Parse(a));
ScriptManager.RegisterStartupScript(Page, GetType(), UniqueID, "ShowPopup('" + date + "');", true);
It wont converts 12:00 AM selected in textbox while it converts other values.