Click or drag to resize

TimeSpanExtensionsToTtl Method (TimeSpan)

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: 3.0.0-local-202004010202+047adc0837bfc29c0b8cce4322194a09afd8ea18
Syntax
C#
public static uint ToTtl(
	this TimeSpan duration
)

Parameters

duration
Type: SystemTimeSpan

[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