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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar question about selecting a month.

Status
Not open for further replies.

jgraves13

Programmer
Jan 31, 2007
42
0
0
US
Is it possible to extract the month from some sort of Date function?

I am building an application that calls the Calendar function and added two dropdown boxes one for Month and one for Year. I would like to select any month and have the calendar go to that month. Does anyone know how this can be down? Can it be down?

~JG
 
Code:
DateTime d = DateTime.Now;
int month = d.Month;

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Can this be done with year as well?

Code:
DateTime d = DateTime.Now;
int year = d.Year;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top