So a DateTime picker control in C# accepts a DateTime object. Now I only need the time portion of it, so what I'm doing right now is creating a DateTime object with a 'dummy' date and the correct time, and just use the time value.
Is there a better way to do this? There's no constructor of DateTime that I know of.
EDIT: I've seen this already C# make datetimepicker work as only timepicker
The problem is that I want to assign a value programatically, not make the picker work as timepicker only.
What I'm doing now to set it to 00:10 is:
TimePicker.Value = DateTime.Today + new TimeSpan(00, 10, 0);
// or
TimePicker.Value = new DateTime(2000,1,1,0,10,0);
Just want to know if there's a cleaner way.