Also if you HAVE to do it with an array here is an example, meant to add
this with last post, but got pulled away to a meeting:
DateTime startDate = DateTime.Parse("01/01/" +
DateTime.Now.Year.ToString());
ArrayList dates = new ArrayList();
for (int i = 0; i <= 364; i++)
{
dates.Add(startDate.AddDays(i));
}
//Pull the date directly from the array list
MessageBox.Show(((DateTime)dates[int.Parse(textBox1.Text)-1]).ToString());
//convert the array list to an array and get the date that way
DateTime[] dateArray = new DateTime[dates.Count];
dates.CopyTo(dateArray);
MessageBox.Show(dateArray[int.Parse(textBox1.Text)-1].ToString());
--
Thanks
"Wayne" <Me******@community.nospam> wrote in message
news:#g**************@TK2MSFTNGP10.phx.gbl...
You really don't need an array to do this, I'm assuming 1 would be Jan 1st
of the current year and 365 would be dec. 31st of the current year:
DateTime startDate = DateTime.Parse("01/01/" +
DateTime.Now.Year.ToString()); //Get the first of the current year
int daysToAdd = int.Parse(textBox1.Text) - 1; //this will allow for 1 to
give you 1/1/2005
DateTime newDate = startDate.AddDays(daysToAdd);
MessageBox.Show(newDate.ToString());
--
Thanks
Wayne Sepega
Jacksonville, Fl
Enterprise Library Configuration Console Module Generator
http://workspaces.gotdotnet.com/elccmg
"When a man sits with a pretty girl for an hour, it seems like a minute.
But let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
"Vikas Arya" <ar*******@hotmail.com(donotspam)> wrote in message
news:43**********************************@microsof t.com... Hi.
Any suggestions on how I might build a form which allows my user to
enter a number from 1-365 and return a date in the 'mm/dd' format?
I would like to use an array to do this. Thanks.
--
Thanks,
Vikas Arya