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

前端 未结 2 1411
借酒劲吻你
借酒劲吻你 2021-01-27 06:51

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

相关标签:
2条回答
  • 2021-01-27 07:12

    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>)
    
    0 讨论(0)
  • 2021-01-27 07:19

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

    0 讨论(0)
提交回复
热议问题