DateTimeExtensions.FromNow Method

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

Overloads

FromNow(DateTime, bool) Returns a textual representation of the specified date from now. This is sometimes called "time ago" or "relative time".
FromNow(DateTime?) Returns a textual representation of the specified date from now. This is sometimes called "time ago" or "relative time".

FromNow(DateTime, bool)

Returns a textual representation of the specified date from now. This is sometimes called "time ago" or "relative time".

public static string FromNow(this DateTime date, bool abbrev = false)

Parameters

date
System.DateTime

The (UTC) date to return as text.

abbrev
bool

Returns

string

Returns the time from now, e.g. "3 hours ago".

FromNow(DateTime?)

Returns a textual representation of the specified date from now. This is sometimes called "time ago" or "relative time".

public static string FromNow(this DateTime? date)

Parameters

date
System.DateTime?

The (UTC) date to return as text.

Returns

string

Returns the time from now, e.g. "3 hours ago".