I'm trying to convert my DateTime to just Date "dd-MM-yyyy". I cannot get it to work. It seems I'm missing something simple here. I've tried so many different ways of doing this, listed below. I'm now out of ideas.
On my aspx.cs page
On my aspx pageCode:lblduedate.Text = dt.Rows[0]["DueDate"].ToString("dd-MM-yyyy");
I've also on the aspx page, tried different formats ofCode:<td> <asp:Label ID="lblduedate" runat="server" ></asp:Label> </td>
Code:Text='<%# Eval("DueDate", "{0:dd/MM/yyyy}") %>'



Reply With Quote




Bookmarks