Problem with am/pm in GridView
Hi,
I want to show time part of a date type field to a column of GridView. For that I used DataTextFormatString="{0:HH:mm}" while defining column at design time. It works fine but when time is between 12:00 pm to 1:00 pm (which is 2006-11-04 12:10:00.000 in Sql Server in 24 hrs format), it still shows it in GridView as 12:00 am. It should show as 12:00 pm.
Code is as follows:
<asp:GridView ID="grdvwAppointments" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:ButtonField DataTextField="Start_Date" DataTextFormatString="{0:HH:mm}"
</asp:ButtonField>
</Columns>
</asp:GridView>
Any ideas.:)
|