user937194
user937194

Reputation: 383

Formatting the date using Asp.net mvc

I am using the below code to display the update date in my grid. But when I give like this I am getting the format of the date some like this

9/3/2012 6:14:51 PM

  columns.Bound(o => o.Datetime_Updated).Title("Update Date").Width(160);

But I need only hours and min in my code formate something like this

9.3.2012 6:14 PM

Thanks

Upvotes: 1

Views: 89

Answers (1)

Yaakov Ellis
Yaakov Ellis

Reputation: 41480

Try this:

columns
  .Bound(o => o.Datetime_Updated)
  .Title("Update Date")
  .Width(160)
  .Format("{0:MM.dd.yyyy hh:mm tt}");

Reference

Upvotes: 4

Related Questions