开发者

How to add seconds to the value of DateTimePicker?

开发者 https://www.devze.com 2023-01-04 02:19 出处:网络
I need to add seconds to 开发者_运维技巧the value of DateTimePicker. Can anyone tell me why the value remains unchanged after executing following code? And also I want to change the displayed value of

I need to add seconds to 开发者_运维技巧the value of DateTimePicker. Can anyone tell me why the value remains unchanged after executing following code? And also I want to change the displayed value of DateTimePicker to its new value. This should be easy. mmm I dont know why.

Thanks.

protected override void updateTime(uint seconds)
{
    this.dtPicAdmitDate.Value.AddSeconds(seconds);
}


AddSeconds() will return a new DateTime object. Try:

this.dtPicAdmitDate.Value = this.dtPicAdmitDate.Value.AddSeconds(seconds); 
0

精彩评论

暂无评论...
验证码 换一张
取 消