How do I set a DateTimePicker to out put dd/mm/yyyy.
At the moment it is giving me the day, date, month then year.
Thanks.
dateTimePicker1.CustomFormat = "dd/MM/yyyy";
dateTimePicker1.Format = DateTimePickerFormat.Custom;
dateTimePicker1.CustomFormat = "dd/MM/yyyy";
dateTimePicker1.Format = DateTimePickerFormat.Custom;
您需要将属性DateTimePicker.Format
设置为DateTimePickerFormat.Custom
并在DateTimePicker.CustomFormat
属性中设置所需的格式。
// Set the Format type and the CustomFormat string.
dtpDeliveryDate.Format = DateTimePickerFormat.Custom;
dtpDeliveryDate.CustomFormat = "dd-MM-yyyy";
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.