I'm trying to display only date part on my view, value I'm getting from database is pretty big and I really don't need informations like hrs, mns, seconds etc, I'm only interested in date, for example I would like to display only :
17/04/2017
And this is what I've tried so far:
<td>
@Html.DisplayFor(modelItem => ((DateTime)item.ValidFrom).ToString("dd/MM/yyyy"))
</td>
<td>
@Html.DisplayFor(modelItem => ((DateTime)item.ValidTo).ToString("dd/MM/yyyy"))
</td>
Here is the DateType of my Properties:
public System.DateTime ValidFrom { get; set; }
public Nullable<System.DateTime> ValidTo { get; set;
And here is the issue I get: [![enter image description here][1]][1]