DateTimeFormatInfo d = new DateTimeFormatInfo();
int yearnum;
int monthnum;
for (yearnum = 1989; yearnum <= 2013; yearnum++)
{
TreeNode yearnode = new TreeNode();
yearnode.Text = yearnum.ToString();
treeView1.Nodes.Add(yearnode);
for (monthnum = 1; monthnum <= 12; monthnum++)
TreeNode monthnode = new TreeNode();
monthnode.Text = d.MonthNames[monthnum-1].ToString();
yearnode.Nodes.Add(monthnode);
int s = DateTime.DaysInMonth(yearnum, monthnum);
for (int daynum = 1; daynum <= s; daynum++)
TreeNode daynode = new TreeNode();
daynode.Text = daynum.ToString();
monthnode.Nodes.Add(daynode);
}