0

Sorry this is probably duplicated but I couldn't find the right solution.

I want to format my display for to only show the Date not the time as it does now.

Ive tried these things below that i found in similar posts on stack.

 <a href="@(Url.Action<SchedulesController>(c=>c.Edit(schedule.Id)))" class="date">@Html.DisplayFor(m => schedule.UTCStartDate, new { @Value = schedule.UTCStartDate.ToString("dd-MMM-yyyy") })</a>

and

 <a href="@(Url.Action<SchedulesController>(c=>c.Edit(schedule.Id)))" class="date">@Html.DisplayFor(m => schedule.UTCStartDate, "{0:dd/MM/yyyy}" )</a>

How do i just get the date to show? Can I do it on the view or do I need to do it in the viewmodel.

CsharpBeginner
  • 1,753
  • 8
  • 38
  • 68

0 Answers0