Saturday, December 6, 2008

Date Format

In aspx

DataBinder.Eval(Container.DataItem, "DateAdded", "{0:MMM/dd/yyyy}")

this will display Nov/29/2008

2 comments:

fc said...

String.Format("{0:MMM/dd/yyyy}", DataBinder.Eval(Container.DataItem, "DeliveryDate"))

Sep/05/2010

fc said...

string queryString = String.Format("Id=1&StartDate={0:yyyy-MM-dd HH:mm:ss}&EndDate={1:yyyy-MM-dd HH:mm:ss}", range.StartDate, range.EndDate);

queryString will have:

"Id=1&StartDate=2011-09-27 00:00:00&EndDate=2011-09-27 23:59:59"