Click or drag to resize

TimeSpanExtensionsToTimeOnly Method

Converts a TimeSpan to a time-only DateTime value. This is useful when handling SQL-Server Time columns because .Net maps those to TimeSpan objects.

Namespace:  NetQuarry
Assembly:  EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax
public static DateTime ToTimeOnly(
	this TimeSpan span
)

Parameters

span
Type: SystemTimeSpan
The span to convert.

Return Value

Type: DateTime
The time-only DateTime value. The date will be the COM time-only date, 1899-12-30.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TimeSpan. 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).
See Also