 | DateTimeExtensionsToMinutePrecision Method (DateTime) |
Returns the specified DateTime value truncating the precision
to the previous minute.
Namespace:
TestHelperExtensions
Assembly:
CBI.TestHelperExtensions (in CBI.TestHelperExtensions.dll) Version: 2.1.0.1
Syntaxpublic static DateTime ToMinutePrecision(
this DateTime value
)
<ExtensionAttribute>
Public Shared Function ToMinutePrecision (
value As DateTime
) As DateTime
public:
[ExtensionAttribute]
static DateTime ToMinutePrecision(
DateTime value
)
[<ExtensionAttribute>]
static member ToMinutePrecision :
value : DateTime -> DateTime
Parameters
- value
- Type: SystemDateTime
The DateTime value for which precision should be adjusted.
Return Value
Type:
DateTimeA 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
DateTime. 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).
RemarksIs 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