My model
[Display(Name = "Tanggal Lahir")]
[DataType(DataType.Date)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
public DateTime TanggalLahir { get; set; }
My opinion
@Html.EditorFor(m => m.TanggalLahir)
but the data is still saved in the format MM / dd / yyyy.
even my web.config
<system.web>
<globalization uiCulture="en" culture="en-GB"/>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" maxRequestLength="30000000" />
</system.web>
source
share