I have the following code:
<li>Reviewed: @Model.Modified</li>
and a model that looks like this:
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}")]
public DateTime? Modified { get; set; }
However when displayed then the date appears as follows:
REVIEWED: 8/1/2012 2:42:34 PM
Is there a simple way that I could change the way the date
displays so it appears as just 8/1/2012 2PM ?
You can use
DateTime.ToString(format)in your view as well, to format the date the way you want.So in your case, something like: