Home > DeveloperSection > Forums > Set DateTimePicker Control to format YYYYMMDD?
Tanuj Kumar

Total Post:134

Posted on    November-13-2013 7:26 AM

 C# C# 

 1 Reply(s)
 2150  View(s)
Rate this:

I’m using the date time picker control in simple windows form application and I want to format the date in YYYYMMDD format as it is my need. How to do it?

ezra heywood
ezra heywood

Total Post:145

Posted on    November-13-2013 7:49 AM

Hi Tanuj,

You need to get the DateTime value from the date time picker then change it to string with the format.

string formateddate = dtpDate.Value.ToString("yyyyMMdd");

Hope this will solve your problem.

Don't want to miss updates? Please click the below button!

Follow MindStick