I have used following code :
<asp:HyperLink ID="Time" runat="server" Text='<%#Eval("CREATED_ON")%>'> </asp:HyperLink>
It will display the date in the format: 11/4/2010 10:52:33 AM
But I want it to display 11/4/2010
. How would I do this?
You should be able to use something like this:
<asp:HyperLink ID="lnkCreatedDate" runat="server" Text='<%#Eval("CREATED_ON", "{0:dd/M/yyyy}")%>'> </asp:HyperLink>
You can try this -
<asp:HyperLink ID="lnkCreatedDate1" runat="server" Text='<%# DateTime.Parse(Eval("CREATED_ON").ToString()).ToString("d") %>'> </asp:HyperLink>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With