The DisplayFormat attribute (as its name suggests) is used only to display the property value using the specified format. This has nothing to do with verification.
In this case, the check is performed using the default binder when it tries to set the POSTed string to the DateTime property. It uses a standard locale, which can be specified in your web.config using the globalization element:
<system.web> ... <globalization culture="de-DE" uiCulture="de-DE"/> </system.web>
The reason your code doesnβt work when deployed to an Azure instance is because it is likely that the server is configured to use an en-US culture for which the date format is different.
If you want to use some more specific format, you can also write your own model linking device for your viewing model and manually analyze the POSTED value inside using this special custom format.
source share