asp.net mvc - How to change Time Format from 24 Hours to 12 in MVC View -
i want change time
06/08/2015 15:55:31
to
06/08/2015 03:55 pm
here code.
<td > @html.displayfor(modelitem =>item.received) //date column @html.hiddenfor(modelitem => item.received, new { @class = "fieldname" }) </td>
decorate property displayformatattribute
[displayformat(dataformatstring = "{0:mm/dd/yyyy hh:mm tt}")] public datetime received { get; set; }
Comments
Post a Comment