Display DateTime value in dd/mm/yyyy format in MVC4
Is it possible display a DateTime value in dd/mm/yyyy format by means of
HTML Hepler methods in MVC4? I Have 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 and different ways to
do this would be appreciated.
Model:
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode
= true)]
public Nullable<System.DateTime> ResgistrationhaseDate { get; set; }
Regards.
No comments:
Post a Comment