I am trying to fetch just the date from the DateTime Entity in the View which I created in the Models. But instead it shows the whole DateTime Format
I added an Annotation [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:MM/dd/yyyy}")], but the issue remains.
//Models:
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:MM/dd/yyyy}")]
public DateTime? BirthDate { get; set; }
//Adding Migration, it processed it as:
BirthDate = table.Column<DateTime>(nullable: false)
//Index View:
@foreach(var customers in Model)
{
@customers.BrithDate
}
I expect the output as Friday January 1, 1990 or 1/1/1990 at least. But the output is 1/1/1990 12:00:00 AM