CSharp examples for System:DateTime Minute
Round To Minutes
using System.Globalization; using System.Collections.Generic; using System;/* ww w . j a v a2 s . co m*/ public class Main{ [Obsolete("Use RoundToMinute(DateTime, int)")] public static DateTime RoundToMinutes(DateTime dateTime, int minInterval) { var min = dateTime.Minute / minInterval * minInterval; return new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, min, 0, dateTime.Kind); } }