DateTimeExtensions.GetRelativeTime(DateTime) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets string literal for relative time from now since the DateTime provided. String output is in most appropriate "x time units ago" Example: If DateTime provided is 30 seconds before now, then result will be "30 seconds ago"
public:
[System::Runtime::CompilerServices::Extension]
static System::String ^ GetRelativeTime(DateTime time);
public static string GetRelativeTime (this DateTime time);
static member GetRelativeTime : DateTime -> string
<Extension()>
Public Function GetRelativeTime (time As DateTime) As String
Parameters
- time
- DateTime
DateTime in UTC to compare against DateTime.UtcNow
Returns
Encoded string.