Wendelius
Поскольку вы также отображаете секунды (...ToString ("HH:mm: ss")), вам, вероятно, также нужно установить секунды на ноль, иначе вы просто сдвинете минуту.
Рассмотреть следующее
System.DateTime time = new DateTime(2017, 1, 11, 23, 35, 28);
for (int counter = 0; counter < 70; counter++) {
// increment time
time = time.AddSeconds(1);
// print the rounded time
Console.WriteLine( string.Format("Original time {0}, rounded time {1}",
time.ToLongTimeString(),
time.AddMinutes(time.Second < 30 ? 0 : 1)
.AddSeconds(time.Second * -1).ToLongTimeString()));
}
Результат будет выглядеть следующим образом
Original time 23:35:29, rounded time 23:35:00
Original time 23:35:30, rounded time 23:36:00
Original time 23:35:31, rounded time 23:36:00
Original time 23:35:32, rounded time 23:36:00
Original time 23:35:33, rounded time 23:36:00
Original time 23:35:34, rounded time 23:36:00
Original time 23:35:35, rounded time 23:36:00
Original time 23:35:36, rounded time 23:36:00
Original time 23:35:37, rounded time 23:36:00
Original time 23:35:38, rounded time 23:36:00
Original time 23:35:39, rounded time 23:36:00
Original time 23:35:40, rounded time 23:36:00
Original time 23:35:41, rounded time 23:36:00
Original time 23:35:42, rounded time 23:36:00
Original time 23:35:43, rounded time 23:36:00
Original time 23:35:44, rounded time 23:36:00
Original time 23:35:45, rounded time 23:36:00
Original time 23:35:46, rounded time 23:36:00
Original time 23:35:47, rounded time 23:36:00
Original time 23:35:48, rounded time 23:36:00
Original time 23:35:49, rounded time 23:36:00
Original time 23:35:50, rounded time 23:36:00
Original time 23:35:51, rounded time 23:36:00
Original time 23:35:52, rounded time 23:36:00
Original time 23:35:53, rounded time 23:36:00
Original time 23:35:54, rounded time 23:36:00
Original time 23:35:55, rounded time 23:36:00
Original time 23:35:56, rounded time 23:36:00
Original time 23:35:57, rounded time 23:36:00
Original time 23:35:58, rounded time 23:36:00
Original time 23:35:59, rounded time 23:36:00
Original time 23:36:00, rounded time 23:36:00
Original time 23:36:01, rounded time 23:36:00
Original time 23:36:02, rounded time 23:36:00
Original time 23:36:03, rounded time 23:36:00
Original time 23:36:04, rounded time 23:36:00
Original time 23:36:05, rounded time 23:36:00
Original time 23:36:06, rounded time 23:36:00
Original time 23:36:07, rounded time 23:36:00
Original time 23:36:08, rounded time 23:36:00
Original time 23:36:09, rounded time 23:36:00
Original time 23:36:10, rounded time 23:36:00
Original time 23:36:11, rounded time 23:36:00
Original time 23:36:12, rounded time 23:36:00
Original time 23:36:13, rounded time 23:36:00
Original time 23:36:14, rounded time 23:36:00
Original time 23:36:15, rounded time 23:36:00
Original time 23:36:16, rounded time 23:36:00
Original time 23:36:17, rounded time 23:36:00
Original time 23:36:18, rounded time 23:36:00
Original time 23:36:19, rounded time 23:36:00
Original time 23:36:20, rounded time 23:36:00
Original time 23:36:21, rounded time 23:36:00
Original time 23:36:22, rounded time 23:36:00
Original time 23:36:23, rounded time 23:36:00
Original time 23:36:24, rounded time 23:36:00
Original time 23:36:25, rounded time 23:36:00
Original time 23:36:26, rounded time 23:36:00
Original time 23:36:27, rounded time 23:36:00
Original time 23:36:28, rounded time 23:36:00
Original time 23:36:29, rounded time 23:36:00
Original time 23:36:30, rounded time 23:37:00
Original time 23:36:31, rounded time 23:37:00
Original time 23:36:32, rounded time 23:37:00
Original time 23:36:33, rounded time 23:37:00
Original time 23:36:34, rounded time 23:37:00
Original time 23:36:35, rounded time 23:37:00
Original time 23:36:36, rounded time 23:37:00
Original time 23:36:37, rounded time 23:37:00
Original time 23:36:38, rounded time 23:37:00
Конечно, на вывод влияют Мои настройки локали, поэтому, если вам нужен фиксированный формат, то вполне возможно использовать пользовательскую модель формата.