/// <summary> /// Returns a <see cref="DateTime"/> value that is rounded either towards negative infinity or positive infinity. /// </summary> /// <param name="value">A <see cref="DateTime"/> value to be rounded.</param> /// <param name="interval">The <see cref="TimeSpan"/> value that specifies the rounding of <paramref name="value"/>.</param> /// <param name="direction">One of the enumeration values that specifies the direction of the rounding.</param> /// <returns>A <see cref="DateTime"/> value that is rounded either towards negative infinity or positive infinity.</returns> /// <exception cref="ArgumentOutOfRangeException"> /// <paramref name="direction"/> is an invalid enumeration value. /// </exception> /// <exception cref="ArgumentOutOfRangeException"> /// <paramref name="interval"/> is <see cref="TimeSpan.Zero"/>. /// </exception> public static DateTime Round(this DateTime value, TimeSpan interval, VerticalDirection direction) { return(DateTimeUtility.Round(value, interval, direction)); }
/// <summary> /// Returns a <see cref="DateTime"/> value that is rounded either towards negative infinity or positive infinity. /// </summary> /// <param name="value">A <see cref="DateTime"/> value to be rounded.</param> /// <param name="interval">The <see cref="double"/> value that in combination with <paramref name="timeUnit"/> specifies the rounding of <paramref name="value"/>.</param> /// <param name="timeUnit">One of the enumeration values that specifies the time unit of <paramref name="interval"/>.</param> /// <param name="direction">One of the enumeration values that specifies the direction of the rounding.</param> /// <returns>A <see cref="DateTime"/> value that is rounded either towards negative infinity or positive infinity.</returns> /// <exception cref="ArgumentOutOfRangeException"> /// <paramref name="direction"/> is an invalid enumeration value. /// </exception> /// <exception cref="ArgumentOutOfRangeException"> /// <paramref name="interval"/> is <see cref="TimeSpan.Zero"/>. /// </exception> public static DateTime Round(this DateTime value, double interval, TimeUnit timeUnit, VerticalDirection direction) { return(DateTimeUtility.Round(value, interval, timeUnit, direction)); }