DateTimeExtensions.ToStringRelative Method

Namespace:
Weavy.Core.Helpers
Assembly:
Weavy.Core.dll

ToStringRelative(TimeSpan, bool)

Returns a textual representation of a time span.

public static string ToStringRelative(this TimeSpan duration, bool abbrev = false)

Parameters

duration
System.TimeSpan

The time span to return as text.

abbrev
bool

Returns

string

Returns the time as readable text, e.g. "3 hours".