Click or drag to resize

PFDateTimeExtensionsGetNaturalDate Method (DateTimeOffset, PFTranslations, RelativeTimeResolution)

Expresses the time difference between the given DateTimeOffset and the current time in a user-friendly translated text. E.g. "9 weeks ago".

Namespace:  Packflow.Interface
Assembly:  MicaSystems.Packflow.Interface (in MicaSystems.Packflow.Interface.dll) Version: 1.0.0.0 (2.0.0.223)
Syntax
C#
public static string GetNaturalDate(
	this DateTimeOffset date,
	PFTranslations translations,
	RelativeTimeResolution resolution
)

Parameters

date
Type: SystemDateTimeOffset
The relative DateTimeOffset.
translations
Type: Packflow.InterfacePFTranslations
Object providing translations used to generate the expected text.
resolution
Type: Packflow.InterfaceRelativeTimeResolution
Value specifying how the natural date must be expressed.

Return Value

Type: String
A text representing the time difference.

Usage Note

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