How to set internationalization to a DateTimepicker
or Calendar WinForm
control in .Net when the desire culture is different to the one installed in the PC?
The DateTimePicker control allows selecting a date and time by editing the displayed values in the control. If you click the arrow in the DateTimePicker control, it displays a month calendar, like a combo box control. The user can make selection by clicking the required date.
The DatePicker control allows the user to select a date by either typing it into a text field or by using a drop-down Calendar control.
A DateTimePicker allows the user to select dates and times.
It doesn't seem to be possible to change the culture. See this KB article.
Based on previous solution, I think the better is:
dateTimePicker.Format = DateTimePickerFormat.Custom;
dateTimePicker.CustomFormat = Application.CurrentCulture.DateTimeFormat.ShortDatePattern;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With