TimeSpanExtensions ToTtl Method Couchbase .NET SDK 2.0
Converts a TimeSpan into an uint correctly representing a Time-To-Live, that is expressed in seconds. Durations strictly bigger than 30 days are converted to a unix-syle timestamp (seconds since the Epoch), as described in the couchbase TTL documentation.

Namespace: Couchbase.Utils
Assembly: Couchbase.NetClient (in Couchbase.NetClient.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax
public static uint ToTtl(
	this TimeSpan duration
)

Parameters

duration
Type: System TimeSpan

[Missing <param name="duration"/> documentation for "M:Couchbase.Utils.TimeSpanExtensions.ToTtl(System.TimeSpan)"]

Return Value

Type: UInt32
The TTL, expressed as a suitable uint.

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