Share via


SPRelativeDateTime.GetRelativeDateString method

Returns a relative datetime given the current time and a time in the past.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Shared Function GetRelativeDateString ( _
    web As SPWeb, _
    now As DateTime, _
    then As DateTime _
) As String
'Usage
Dim web As SPWeb
Dim now As DateTime
Dim then As DateTime
Dim returnValue As String

returnValue = SPRelativeDateTime.GetRelativeDateString(web, _
    now, then)
public static string GetRelativeDateString(
    SPWeb web,
    DateTime now,
    DateTime then
)

Parameters

Return value

Type: System.String
A localized string which represents the relative time difference for visual display.

See also

Reference

SPRelativeDateTime class

SPRelativeDateTime members

Microsoft.SharePoint.Utilities namespace