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
- web
Type: Microsoft.SharePoint.SPWeb
now
Type: System.DateTimeThe current time.
then
Type: System.DateTimeThe previous time.
Return value
Type: System.String
A localized string which represents the relative time difference for visual display.