Date Time string formatting in ASP.NET With the following code you can format a DateTime within a Databind.
<%# DateTime.Parse(Eval("DateModified").ToString()).ToString("MM-dd-yyyy")%>
Some more format specifiers that can change format of datetime objects the way it is required.
Format specifier
Name
d
Short date pattern
D
Long date pattern
t
Short time pattern
T
Long...
by Nauman at December 24th, 2009 at 04:12 am