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!

Date Picker Value 1

Status
Not open for further replies.

MJV57

Programmer
Apr 18, 2009
87
CA
How can I extact the date from a date picker as a number. Ex. May 25,2009 as 20090525
 
Code:
var dateAsDate = MyDatePicker.Value;
var dateAsString = dateAsDate.ToString("yyyyMMdd");
var dateAsInteger = int.Parse(dateAsString);

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Is there a way to do this without var as Im not familiar with this
 
Code:
DateTime dateAsDate = MyDatePicker.Value;
string dateAsString = dateAsDate.ToString("yyyyMMdd");
int dateAsInteger = int.Parse(dateAsString);

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top