I\'m using the following code
// Model
[DisplayFormat(
ApplyFormatInEditMode = true,
DataFormatString = \"{0:dd/MM/yyyy}\")]
public DateTime StartDa
Can you change it to DataFormatString = "{0:d}"
That should give you the short date pattern of mm/dd/year
Change the Short date format of the server' Regional settings to use slashes e.g. yyyy/MM/dd
.
This solved the issue for me.
Use DataFormatString = @"{0:dd\/MM\/yyyy}"
instead. Since the /
identifies a character that should be replaced by the default date separator for the current culture, you need to escape it in order for it to be used as a literal in the format.
This way you have a fixed format instead of one that dynamically uses the date separator of the current culture.
An alternative to escape the /
character can be: DataFormatString = "{0:dd'/'MM'/'yyyy}"