How to Show Date Format in Webgrid in MVC3 as “MM/

2020-05-06 13:54发布

问题:

How do I show Date Format in Webgrid in MVC3 as "MM/dd/yyyy"?

回答1:

you haven't shown any code so, im going to answer what i have got you can try

grid.Column("Date",format:@<text> @item.Date.ToString("MM/dd/yyyy")</text>)


回答2:

PLease don't use magic format in ToString. You can set cultury in server or client. and use Date.ToShortDate()