473,473 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Time format on a web page

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
May 16 '07 #1
1 1344
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

"MN" <MN@discussions.microsoft.comwrote in message
news:69**********************************@microsof t.com...
>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
May 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Brian | last post by:
I have 4 sites sharing an account on a server that is in the US Eastern time zone. 3 of those sites are for businesses/persons who live in the same time zone, but one is for a restaurant in the US...
12
by: Rick | last post by:
I need to store a date prior to the unix epoch, any pointers? -- Rick Digital Printing www.intelligence-direct.com
1
by: Neal | last post by:
I have a MySQL table with a datetime field that stamps the time the user submitted the form. It works and looks like this: $sql = "INSERT INTO table VALUES(....now())"; On another php page to...
1
by: Shaiboy_UK | last post by:
Hi All, Sorry if this is the wrong newsgroup to post into, on this topic, if so, please point me in the right direction..... Currently working on a ASP for a friend, which requires the date...
6
by: Kenneth | last post by:
Hello, I'm having some serious problems debugging a script that I'm trying to make work. I'm working on a form where a user can type in a time (in the format of HH:MM), and another script...
5
by: Flzw | last post by:
Is there a standard library (C or C++) to convert a time in seconds since Jan, 1st 1970 into a formatted datetime string ?
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
5
by: Julia | last post by:
Hi I have changed my regional options on my computer to English (United States) (I used to have Swedish). I would print the value of the current time in a textbox on my asp.net page. I use this...
1
by: Susan Bricker | last post by:
Greetings. I have a report (actually all of my reports in an MDB) that I want to date/time stamp at the bottom. Previously, I had used the builtin function of Now(). I thought that would give...
14
by: shapper | last post by:
Hello, Is there any function to convert a Date/Time from UTC to the user client zone and back from user client zone to UTC? I want to store Date/Time in UTC in the database but display it in...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.