views:

42

answers:

1

Hi,

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);
}
+3  A: 

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

this.dtPicAdmitDate.Value = this.dtPicAdmitDate.Value.AddSeconds(seconds); 
Xavier Poinas
Thanks! I feel stupid :)
Kavinda Gayashan