I'm struggling myself trying to find an easy way to change the DateTime format for my Table field.
I have a Model called Article with a field called releaseDate that is a DateTime
I managed to do it (visually) by converting the
Article.releaseDate.ToString("dd/MM/yy")
but the thing is when I try to submit a date with this format from the create action it returns an error telling the the format is wrong.
Any easy way to change the default ("MM/dd/yy") to ("dd/MM/yy")?
Thanks in advance
Best Solution
You could change the culture information on a page by page basis by including
or globally across all pages by adding to your web.config
Both will change the DateTime model binding to dd/MM/yyyy so no conversion is necessary.
See this question for more information
The code equivalent is