 | DateTimeExtensionsTo100MSPrecision Method (NullableDateTime) |
Returns the specified DateTime value truncating the precision
to the previous 100 millisecond increment. 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
Syntaxpublic static Nullable<DateTime> To100MSPrecision(
this Nullable<DateTime> value
)
<ExtensionAttribute>
Public Shared Function To100MSPrecision (
value As Nullable(Of DateTime)
) As Nullable(Of DateTime)
public:
[ExtensionAttribute]
static Nullable<DateTime> To100MSPrecision(
Nullable<DateTime> value
)
[<ExtensionAttribute>]
static member To100MSPrecision :
value : Nullable<DateTime> -> Nullable<DateTime>
Parameters
- value
- Type: SystemNullableDateTime
The DateTime value for which precision should be adjusted.
Return Value
Type:
NullableDateTimeA Nullable DateTime value representing the target value modified to be precise only to 100ms.
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).
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