Reputation: 37633
Can we apply somehow the format for this?
[Display(Name = "Date of Birthday")]
[DataType(DataType.Date)]
public DateTime DOB { get; set; }
I'd like to see only Date and not Time.
Thank you!
Upvotes: 5
Views: 28043
Reputation: 150108
You can use the DisplayFormatAttribute
Specifies how data fields are displayed and formatted by ASP.NET Dynamic Data.
[DisplayFormat(DataFormatString = "{0:dd MMM yyyy}")]
[Display(Name = "Date of Birthday")]
[DataType(DataType.Date)]
public DateTime DOB { get; set; }
Upvotes: 16