Skip navigation.

Book Review: PeoplewareAll recent postsTreehouse: New Online Magazine For Web Aficionados

MonthNames Property Returns 13 Months?!

What I love about the DateTimeFormatInfo class is that it allows you to get a list of day and month names in the language of the current culture. It took me aback the other day that MonthNames property returned an array of 13 strings, twelve of which were month names plus one empty entry.

Upon closer inspection you notice MSDN says,

In a 12-month calendar, the 13th element of the array is an empty string. […] Calendar objects accommodate calendars with 13 months.

Of the calendars, supported by .NET, the HebrewCalendar class may have 13 months:

The Hebrew calendar has 12 months during common years and 13 months during leap years.

That explains it. It would’ve been handy to just bind a list of months to a date picker, but… Internationalization has never been easy.

Comments

No comments yet

Emails and Notifications

Would you like to be notified when somebody responds to this post? 

TrackBacks

Sorry, TrackBacks are not allowed.

Submit your comment

Please enter only text since all HTML tags except hyperlinks will be stripped. Hyperlinks will become live links. Any comments with flaming or offensive language will be deleted. Be courteous to other posters. Thank you.

Your name (required):
Your email (optional):
Your site's URL (optional):
Enter this number
Type in the number above:
Comment (required):