0

Hi I'm new to MVC3 and if run into a little problem I can't seem so solve.

I have a value in one of my table's that represents the national holiday of a country. So it only contains a day and a month. Now I'm unable to find a way to set my entities validations this way it only accepts a day/month combination.

I tried using

[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/mm}")]

But then it would only show the days correctly and alwayse make the months "00"

Anyone know how to fix this?

1
  • 1
    keyword "DateTime MVC3 ASP format". mm means minutes Commented Mar 11, 2012 at 9:08

1 Answer 1

3

mm means minutes in a DateTime format string. Use MM instead for months.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.