AppVeyor.Common.Extensions.DateTimeExtensions.Round C# (CSharp) Method

Round() public static method

public static Round ( this date, System.TimeSpan span ) : System.DateTime
date this
span System.TimeSpan
return System.DateTime
        public static DateTime Round(this DateTime date, TimeSpan span)
        {
            long ticks = (date.Ticks + (span.Ticks / 2) + 1) / span.Ticks;
            return new DateTime(ticks * span.Ticks);
        }