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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -