So I have a field in a class, but for some reason it is comming back with an uninitialised value of 0001.01.01.
private static DateTime start = new DateTime(2011, 1, 1);
There's another static method used as an initializer in another field.
private static readonly DateTime[] dates = SetupDates(20 * 12);
private static DateTime[] SetupDates(int n){
var d = start;
....
}
I thought that "new" in start would need to be completed before before SetupDates could continue... so local variable d would contain 2011.1.1. Looks like I'm mistaken, and I should use a static constructor instead. Is this behaviour to be expected?