2
Answers

datetimepicker not adding hours

Thomas

Thomas

12y
1.4k
1
ok I have the following line of code and it does not appear doing anything and I'm not sure why or what I'm missing. SchedTransDate is a DateTimePicker and the 4 is actually a calculated value but even when I put in the straight number 4 instead of calcing it, the time stamp does not get updated properly

 SchedTransDate.Value = SchedTransDate.Value.AddHours(4);

instead it appears to just update the time stamp with the current time not the calculated time.

(basically if certain conditions are met I want to force the time stamp to be a certain time. However it does not allow me to just assign the time stamp (at least not in any way I can find)

Answers (2)