Time format on a web page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a simple app that lists some times from a SQL database

dt.Columns.Add(New DataColumn("Start Time", GetType(String)))
Dim cn As New SqlConnection(sqlConnString)
cn.Open()
sqlStatement = "Select EndTime from Mytable
Dim cmd As New SqlCommand(sqlStatement, cn)
Dim dr As SqlDataReader = cmd.ExecuteReader
Do While dr.Read()
MyDataRow = dt.NewRow()
MyDataRow(0) = dr.GetString(0)

dt.Rows.Add(MyDataRow)
DataGrid1.databind

....
so thequestion is if I amtrying to add the date to the datagrid, how can I
convert it to military format (13:00 instead of 1:00)?

Thanks in advance
 
Hello,

if you have that column bound to a BoundColumn in the datagrid, you can
specify a format string of "HH:mm" in the DataFormatString of the column
definition of the datagrid.

Best regards,
Henning Krause
 
Back
Top