Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Code To Calculate Future Date 1

Status
Not open for further replies.

MJV57

Programmer
Apr 18, 2009
87
CA
I have a form with a start date supplied and I would like to add a certain number of days as designated in a text box to determine the future date. Can anyone help with this. The date supplied is in a datepickerbox
 
i'll assume you can get the values from the input controls. that said, just add the days. it's all part of the DateTime object.
Code:
int days = GetNumberFromTextbox();
DateTime date = GetDateFromPicker();
DateTime futureDate = date.AddDays(days);

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top