上传者: gutianyao
|
上传时间: 2022-06-11 23:07:09
|
文件大小: 252B
|
文件类型: TXT
创建2个DateTimePicker,分别为datetimepicker1和datetimepicker2,1用来显示日期,2用来显示时间。
代码如下:
////日期
datetimepicker1.Format = DateTimePickerFormat.Custom;
datetimepicker1.CustomFormat = "yyyy:MM:dd";
////时间
datetimepicker2.Format = DateTimePickerFormat.Time;
datetimepicker2.CustomFormat = "HH:mm:ss";
datetimepicker2.ShowUpDown = true;