03/04/2013 00:00:00
03/04/2013
" <asp:Label ID="lbldate" runat="server" style="background:none; padding:0; margin:0" Text='<%# Eval("_News_Date", "{0:dd/MM/yyyy}") %>' >"
convert(char,_News_Date,103) as _News_Date
dd/mm/yyyy
<asp:Label ID="lblDate" runat="server" Text='<%# Convert.ToDateTime(Eval("_News_Date")).ToString("dd/MM/yyyy") %>'></asp:Label>
DECLARE @myDate DATETIME SET @myDate = '2013/03/29' SELECT @myDate AS MyDate --returns: 2013/03/29 00:00:00.000 SELECT CONVERT(NVARCHAR(10), @myDate, 103) AS MyDate --returns: 29/03/2013
select convert(char,_News_Date,103) as _News_Date From tbl Order by _News_Date asc
<asp:Label ID="lbldate" runat="server" Text='<%# formatDate(Eval("new_date","{0:MM/dd/yyyy}"))%>'></asp:Label>
protected string formatDate(string date) { if (date == null || date == "1/1/0001") { return ""; } else { return date; } }
DateTime date = (DateTime.Now).ToString("yyyy/M/d"));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)