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!

Format Date

Status
Not open for further replies.

robertfah

Programmer
Mar 20, 2006
380
US
I've got a windows app that uses a date time picker (calendar control). When I pick the date, I always want it stored as so: mm/dd/yyyy Does anyone know how I can achieve this? As it is now, if I pick April 4, 2008 it will store 4/4/2008, when I really want 04/04/2008.
 
Figured it out"
Code:
DateTime dtStartDate = deStartDate.DateTime;
string sStartDate = dtStartDate.ToString("MM/dd/yyyy");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top