Click or drag to resize

DateTimeExtensionsToMinutePrecision Method (NullableDateTime)

Returns the specified DateTime value truncating the precision to the previous minute. If the nullable value has no value, a null is returned.

Namespace:  TestHelperExtensions
Assembly:  CBI.TestHelperExtensions (in CBI.TestHelperExtensions.dll) Version: 2.1.0.1
Syntax
public static Nullable<DateTime> ToMinutePrecision(
	this Nullable<DateTime> value
)

Parameters

value
Type: SystemNullableDateTime
The DateTime value for which precision should be adjusted.

Return Value

Type: NullableDateTime
A Nullable DateTime value representing the target value modified to be precise only to the minute.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type NullableDateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
Is often used to make DateTime comparisons work better since a difference in precision between 2 DateTime values will cause comparisons to fail that should otherwise match.
See Also