Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does DateTimeInfo.MonthNames return a 13 member? [duplicate]

Possible Duplicate:
GetMonthName: Valid values are between 1 and 13, inclusive. Why?

The following code:

DateTimeFormatInfo datetimeinfo = new CultureInfo("en-GB", false).DateTimeFormat;
string[] months = datetimeinfo.MonthNames;

returns 13 members, with 0 being January and 13 being an empty string.

Why is this?

It's no big deal as I can just remove the last member, but I just wondered if there was a point to it.

like image 502
Piers Karsenbarg Avatar asked Nov 25 '11 11:11

Piers Karsenbarg


1 Answers

Some calendars, notably the Hebrew, can have 13 months. This tends to be in lunisolar calendars which use Lunar months, and then add an extra month every few years to avoid the start of the year changing too much from the solar year.

like image 134
Richard Avatar answered Oct 20 '22 06:10

Richard