DateTimePicker

T

Tony

Hello!

I have a DateTimePicker in my form and I have set it back one day by using
this statement
this.stopTimeDateTimePicker.Value = DateTime.Today.AddDays(-1);
this work.

Now to my question
The problem is that the time is set to 00:00:00 but I want to have it set to
23:59:59

//Tony
 
J

Joe Cool

Hello!

I have a DateTimePicker in my form and I have set it back one day by using
this statement
this.stopTimeDateTimePicker.Value = DateTime.Today.AddDays(-1);
this work.

Now to my question
The problem is that the time is set to 00:00:00 but I want to have it setto
23:59:59

//Tony

I am assuming you want the value to be one second before midnight on
the previous day. Just subtract one second instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top