Rounds the specified date to the nearest period.

Namespace: RightEdge.Common
Assembly: Common (in Common.dll) Version: 2010.1.0.0 (2010.1.0.0)

Syntax

C#
public static DateTime RoundTime(
	DateTime date,
	TimeSpan period
)
Visual Basic
Public Shared Function RoundTime ( 
	date As DateTime,
	period As TimeSpan
) As DateTime
Visual C++
public:
static DateTime RoundTime(
	DateTime date, 
	TimeSpan period
)
F#
static member RoundTime : 
        date : DateTime * 
        period : TimeSpan -> DateTime 

Parameters

date
Type: System..::..DateTime
Input date.
period
Type: System..::..TimeSpan
Rounding period.

Return Value

Type: DateTime
Rounded DateTime instance.

See Also