I have a table with Open and Close times (time(0))
It is in 24 hr format,
my first issue is getting the time to display at all
second I would like to convert to am pm
SqlConnection SqlCon = new SqlConnection(Config.ConString);
SqlCommand SqlCom = new SqlCommand("SELECT * FROM CompanyLocationsHours WHERE LocationID = '" + LocationID + "' AND AccountTypeID ='1'", SqlCon);
SqlDataReader SqlDR = SqlCom.ExecuteReader();
MondayCommercial.Text = "Monday: " + Convert.ToString(SqlDR["MondayOpen"]) + " - " + Convert.ToString(SqlDR["MondayClose"]);
TuesdayCommercial.Text = "Tuesday: " + Convert.ToDateTime(SqlDR["TuesdayOpen"]).ToString("hh:mm") + " - " + Convert.ToDateTime(SqlDR["TuesdayClose"]).ToString("hh:mm");
This is my trial, but both labels show no data, yet there is data in the table,and I am pretty sure the string format hh:mm is not the correct way to convert 24hr to 12 hr.
Any help would be appreciated, thanks!
View Complete Post