Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have to change the format of a date in a DateTimePicker.

I do not want to change the date that appears when the calendar is not expanded (the selected date), however, I need to be able to format the date that appears inside the calendar when I expand the DTPicker.

How to grab the inner date (which normally shows the current date)?

Thxs..
Kavir
Posted

1 solution

dtp.Format=DateTimePickerFormat.Custom;
dtp.CustomFormat="dd-MM-yyyy";


You can specify your choice in:
dtp.CustomFormat=""
 
Share this answer
 
v2
Comments
Kavir Bheeroo 20-Nov-12 5:12am    
That's the point I have tried to explain with my question. The solution provided above only helps format the string on the DateTimePicker.

However, when you expand the picker to show the calendar, you encounter a second date that displays the current date. I need to format that second date and it does not work with the solution above.

Thanks though.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900