首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

c#中两个DateTimePicker,一个时间设立为0:0:0,另一个设置为23:59:59

2012-09-03 
c#中两个DateTimePicker,一个时间设置为0:0:0,另一个设置为23:59:59stp1为第一个DateTimePickerthis.dtp1.

c#中两个DateTimePicker,一个时间设置为0:0:0,另一个设置为23:59:59

stp1为第一个DateTimePicker

this.dtp1.Value.Date;

stp2为第二个DateTimePicker

设置dtp2的值的时间部分是23:59:59.

this.dtp2.Value = new DateTime(this.dtp2.Value.Year, this.dtp2.Value.Month, this.dtp2.Value.Day, 23, 59, 59);

注意:

使用的时候

obj_Model.FKRQEnd = dtp2.Value;//这样时间部分值为23:59:59

如果obj_Model.FKRQEnd = dtp2.Value.Date;//这样时间部分值是0:0:0.

热点排行