I have a ViewModel that displays my table
Model
public DateTime? startdate { get; set; }
Controller
var regions = from r in _odb.REGION_MSTR
select new RegionModel
{
regionid = r.REG_ID,
regionname = r.REG_NAME,
status = (r.INACTV_DT == null ? "Active" : "Inactive"),
startdate = r.STRT_DT
};
View
<tbody id="dbBody">
@foreach (var item in Model)
{
<tr>
...
<td class="hidden">
@Html.DisplayFor(modelItem => item.startdate)
</td>
</tr>
}
</tbody>
This will display a 9/16/2016 12:00:00 AM
. How do I remove the 12:00:00 AM
? I tried using DbFunctions.TruncateTime(r.STRT_DT), but still getting date with time.