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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -