日期:2014-05-18  浏览次数:20370 次

GridView中非日期字段转为日期显示。。。。。
想把 20070809175255 转为:2007年08月09日17时52分55秒 在GridView显示出来。

用以下方式不行,发现是因为字段R4不是日期字段导致。
请教高手。。。出出主意。


<ItemTemplate>
  <asp:Label ID="Label1" runat="server" Text='<%# Bind("R4","{0:M-dd-yyyy}") %>'></asp:Label>
  </ItemTemplate>

------解决方案--------------------
select to_date('20070809175255','yyyy-mm-dd hh24:mi:ss') from dual;
------解决方案--------------------
HTML code


<ItemTemplate > 
  <asp:Label ID="Label1" runat="server" Text= ' <%# time(Bind("R4")) % > ' > </asp:Label > 
</ItemTemplate >