DateTimeExtensions..::..Round Method

Round the given DateTime object by the given time interval. i.e. 10:09 rounded by 10 minutes would be 10:10

Namespace:  Core
Assembly:  Core (in Core.dll)

Syntax


public static DateTime Round(
	DateTime dt,
	TimeSpan interval
)

Parameters

dt
Type: DateTime
The given DateTime object
interval
Type: TimeSpan
The time interval to round by

Return Value

The new rounded DateTime object