Re: Using arrays to display a date.
- From: "Wayne" <MeNotYou@xxxxxxxxxxxxxxxx>
- Date: Thu, 7 Apr 2005 08:58:33 -0400
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" <aryavikas@xxxxxxxxxxx(donotspam)> wrote in message
news:43A8D541-E7AF-4090-B2D8-7F8FD37C6E7D@xxxxxxxxxxxxxxxx
> 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
.
- Follow-Ups:
- Re: Using arrays to display a date.
- From: Wayne
- Re: Using arrays to display a date.
- References:
- Using arrays to display a date.
- From: Vikas Arya
- Using arrays to display a date.
- Prev by Date: Re: Form focuse
- Next by Date: Re: Returning values
- Previous by thread: Re: Using arrays to display a date.
- Next by thread: Re: Using arrays to display a date.
- Index(es):
Relevant Pages
|