Is it possible to display a DateTime
value in dd/mm/yyyy format with the help of HTML Helper
methods in Asp.NET MVC
? I tried to do this by using some formats in @Html.LabelFor
and adding some annotations to the related property like below but it does not make any sense. Any help to solve this problem would be appreciated.
Model:
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
public Nullable<System.DateTime> RegistrationDate { get; set; }