Time format on a web page

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
 
H

Henning Krause [MVP - Exchange]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top