Cannot format SQL 2008 Time

D

David C

I have a GridView that displays a bound time(0) data type from SQL Server
2008. I am trying to get a bound field to display as 8:30 AM, for example,
and it displays as 08:30:00 instead. If I do the same on a SQL Datetime
column it works great. Is there some other formatting I should use? Below
is the bound column entry in the GridView. Thanks.

David

<asp:Label ID="LblToDoTime" runat="server" HtmlEncode="false" Text='<%#
Bind("ToDoTime", "{0:h:mm tt}") %>'></asp:Label>
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top