public static DateTime Round(DateTime dt, int dir, int interval)
{
DateTime t;
if (dir == 1)
t = dt.AddMinutes((60 - dt.Minute) % interval);
else
t = dt.AddMinutes(-dt.Minute % interval);
return t;
}
For the StartTime, you will use:
DateTime startTime = Round(Now, 1, 30);
For the second combobox, you will use:
DateTime nextTime = startTime.AddMinutes(30);