Formatting Time Output
I have a listview control that I am trying to format the time on. The catch is that this is a SQL 2008 database. The datatype of the EVENT_TIME column is the new SQL 2008 TIME datatype so it seems that the traditional way of formatting the output doesn't work.
The value in the database is "18:30:00", however, I want it to show up as "6:30 PM" instead.
This code outputs it as "18:30:00" even though the formatting is specified:
<asp:Label ID="LBL_TIME" runat="server" Text='<%# Eval("EVENT_TIME", "{0:hh:mm tt}")%>' />
Any help would be appreciated.
|