I thought by setting up the custom format of date time picker to |MM/dd/yy hh:mm tt" would work, but the selection doesn't change from date picker only! I need an object that I can be able to choose both date and time.

..., but the selection doesn't change from date picker only! I need an object that I can be able to choose both date and time.

Can you please elaborate this issue a bit precisly?

and this works:

DateTime date = dateTimePicker1.Value;
string strDate = String.Format("{0:MM/dd/yy hh:mm tt}", date);

thx,
Mitja

You can use this, but then you can only select time
timePicker.Format = DateTimePickerFormat.Time;

I think I've done it. I set showupanddown to true and I can set now the time and date using an up and down scroll.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.