13th Month ?
-
I was writing an application which takes credit card payment and to create a list of months I used
DateTimeFormatInfo.InvariantInfo.MonthNames
and I got surprised when I got 13 elements as a return. Jan to Dec and an empty month. I wonder why it was done like that ?
string[] allMonths = DateTimeFormatInfo
.InvariantInfo
.MonthNames;
Console.WriteLine("No of Months : {0}", allMonths.Length); // And you get 13for (int i = 0; i < allMonths.Length; i++) Console.WriteLine("Month {0} {1}", i, allMonths\[i\]);
Why put 13th element as "" string ?
Zen and the art of software maintenance : rm -rf * Maths is like love : a simple idea but it can get complicated.
Apparently it's to do with
Calendar
objects using 13 months as well. This rabbit hole runs deep. DateTimeFormatInfo.MonthNames Property (MSDN)[^]Jeremy Falcon
-
I was writing an application which takes credit card payment and to create a list of months I used
DateTimeFormatInfo.InvariantInfo.MonthNames
and I got surprised when I got 13 elements as a return. Jan to Dec and an empty month. I wonder why it was done like that ?
string[] allMonths = DateTimeFormatInfo
.InvariantInfo
.MonthNames;
Console.WriteLine("No of Months : {0}", allMonths.Length); // And you get 13for (int i = 0; i < allMonths.Length; i++) Console.WriteLine("Month {0} {1}", i, allMonths\[i\]);
Why put 13th element as "" string ?
Zen and the art of software maintenance : rm -rf * Maths is like love : a simple idea but it can get complicated.
-
I was writing an application which takes credit card payment and to create a list of months I used
DateTimeFormatInfo.InvariantInfo.MonthNames
and I got surprised when I got 13 elements as a return. Jan to Dec and an empty month. I wonder why it was done like that ?
string[] allMonths = DateTimeFormatInfo
.InvariantInfo
.MonthNames;
Console.WriteLine("No of Months : {0}", allMonths.Length); // And you get 13for (int i = 0; i < allMonths.Length; i++) Console.WriteLine("Month {0} {1}", i, allMonths\[i\]);
Why put 13th element as "" string ?
Zen and the art of software maintenance : rm -rf * Maths is like love : a simple idea but it can get complicated.
-
I was writing an application which takes credit card payment and to create a list of months I used
DateTimeFormatInfo.InvariantInfo.MonthNames
and I got surprised when I got 13 elements as a return. Jan to Dec and an empty month. I wonder why it was done like that ?
string[] allMonths = DateTimeFormatInfo
.InvariantInfo
.MonthNames;
Console.WriteLine("No of Months : {0}", allMonths.Length); // And you get 13for (int i = 0; i < allMonths.Length; i++) Console.WriteLine("Month {0} {1}", i, allMonths\[i\]);
Why put 13th element as "" string ?
Zen and the art of software maintenance : rm -rf * Maths is like love : a simple idea but it can get complicated.
Earth's rotation is gradually getting slower and instead of adding an extra day every couple of years it will one day be more convenient to add an extra month. I guess a good name just hasn't been found yet.
-
Earth's rotation is gradually getting slower and instead of adding an extra day every couple of years it will one day be more convenient to add an extra month. I guess a good name just hasn't been found yet.
-
If you'd follow the pattern it would be Undecember ;)
-
If you'd follow the pattern it would be Undecember ;)
As previously pointed out[^], the official name for the 13th month is "Smarch[^]". :-D https://www.youtube.com/watch?v=mTJ6GPGMozo[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
As previously pointed out[^], the official name for the 13th month is "Smarch[^]". :-D https://www.youtube.com/watch?v=mTJ6GPGMozo[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
I was writing an application which takes credit card payment and to create a list of months I used
DateTimeFormatInfo.InvariantInfo.MonthNames
and I got surprised when I got 13 elements as a return. Jan to Dec and an empty month. I wonder why it was done like that ?
string[] allMonths = DateTimeFormatInfo
.InvariantInfo
.MonthNames;
Console.WriteLine("No of Months : {0}", allMonths.Length); // And you get 13for (int i = 0; i < allMonths.Length; i++) Console.WriteLine("Month {0} {1}", i, allMonths\[i\]);
Why put 13th element as "" string ?
Zen and the art of software maintenance : rm -rf * Maths is like love : a simple idea but it can get complicated.