I am trying to format date time attribute in MVC 4 class like this :
[Required]
[DataType(DataType.Date)]
[DisplayFormat(ApplyFormatInEditMode = true,DataFormatString = "{0:dd/MM/yyyy}")]
public DateTime DateOfBirth { get; set; }
but not work DateOfBirth attribute accept date format month before day (EX:accept 1/27/1990 and not accept 27/1/1990)
I am searching for answers and trying many solution but not work like
using html helper:
@Html.TextBoxFor(Model => Model.DateOfBirth) I appreciate any help thanks