Everyone knows that 2038 goes to be a giant 12 months. In a mere 14 years, a bunch of gadgets are going to have issues.
Much less recognized is the Y2030 downside, which is what Ventsislav combating to guard us from.
//POPULATE YEAR DROP DOWN LISTS
for (int 12 months = 2000; 12 months <= 2030; 12 months++)
{
DYearDropDownList.Gadgets.Add(12 months.ToString());
WYearDropDownList.Gadgets.Add(12 months.ToString());
MYearDropDownList.Gadgets.Add(12 months.ToString());
}
//SELECT THE CURRENT YEAR
string strCurrentYear = DateTime.Now.Yr.ToString();
for (int i = 0; i < DYearDropDownList.Gadgets.Rely; i++)
{
if (DYearDropDownList.Gadgets[i].Textual content == strCurrentYear)
{
DYearDropDownList.SelectedIndex = i;
WYearDropDownList.SelectedIndex = i;
MYearDropDownList.SelectedIndex = i;
break;
}
}
Okay, possible much less crucial than Y2038, however this code, as you would possibly guess, began its life within the 12 months 2000. Clearly, nobody thought it'd nonetheless be in use this far out, but… it’s.
It's additionally value noting that the drop down checklist object in .NET has a SelectedValue
property, so the //SELECT THE CURRENT YEAR
part is pointless, and might be changed by a one-liner.
With six years to go, do you assume this utility goes to get replaced, or is the 12 months
for loop simply going to vary to 12 months <= 2031
and be a handbook change for the remainder of the appliance's lifetime?
I imply, they may additionally change it so it at all times goes to currentYear
or currentYear + 1
or no matter, however do we actually assume that's a viable choice?