Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove space before day and month from DateTimePicker

I have a datetimepicker in a windows application and i want to remove the extra space before the single digit day and month. enter image description here Is there any way to remove this extra space before day 2 and month 1?

like image 310
user2691432 Avatar asked Dec 01 '25 01:12

user2691432


1 Answers

I think you can not change/remove the spaces before the date and month values because your DateTimePicker is set to the custom format M/d/yyyy which displays Month and Date in single digit only(by leaving one digit space before month and date if they are less than 10).

as an alternative you can add Zero before month and date (if they are less than 10).

Try This:

dateTimePicker1.CustomFormat = "MM/dd/yyyy";
dateTimePicker1.Format = DateTimePickerFormat.Custom;
like image 115
Sudhakar Tillapudi Avatar answered Dec 03 '25 16:12

Sudhakar Tillapudi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!