I will try everything but not working this(dd/MM/yyyy) date format, this always gate mm/dd/yyyy
[Display(Name = \"Release D
If you use data-annotation. when display it good. but when edit mode. it still use server format (culture setting) DisplayFormat: like it name, only for display
There are some option to solve. - paste to server as string with your favorite format - write customer bindding - Setting globalization in web.config for Format : dd/MM/yyy i using setting bellow
<system.web>
<globalization culture="en-GB"/>
....
You missed 2 things here:
DataFormatString="{0:dd/MM/yyyy}"; //It is dd/MM/yyyy instead of dd/mm/yyyy
and you also need:
ApplyFormatInEditMode=true
Try to use this:
[Display(Name = "Release Date")]
[DataType(DataType.Date), DisplayFormat( DataFormatString="{0:dd/MM/yyyy}", ApplyFormatInEditMode=true )]
public Nullable<DateTime> release_date { get; set; }
{0:dd/mm/yyyy}
should be {0:dd/MM/yyyy}
because mm
means minutes, not months:
[Display(Name = "Release Date")]
[DataType(DataType.DateTime)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
public Nullable<DateTime> release_date { get; set; }