SET DATETIMEPICKER CONTROL TO FORMAT YYYYMMDD?

Tanuj Kumar

Total Post:134

Points:940
Posted by  Tanuj Kumar
C# 
C#
 3323  View(s)
Ratings:
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?

  1. ezra heywood

    Post:145

    Points:1019
    Re: Set DateTimePicker Control to format YYYYMMDD?

    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.


Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!