SPFieldDateTime.GetFieldValueAsHtml Method (DateTime, SPWeb, SPDateFormat)
Returns the field value in HTML format based on the specified DateTime value, Web site, and date format in order to render the field value directly on the page.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Shared Function GetFieldValueAsHtml ( _
data As DateTime, _
web As SPWeb, _
dateformat As SPDateFormat _
) As String
'Usage
Dim data As DateTime
Dim web As SPWeb
Dim dateformat As SPDateFormat
Dim returnValue As String
returnValue = SPFieldDateTime.GetFieldValueAsHtml(data, _
web, dateformat)
public static string GetFieldValueAsHtml(
DateTime data,
SPWeb web,
SPDateFormat dateformat
)
Parameters
data
Type: System.DateTimeA System.DateTime object that represents the DateTime value to convert.
web
Type: Microsoft.SharePoint.SPWebAn SPWeb object that represents the Web site that contains the field.
dateformat
Type: Microsoft.SharePoint.Utilities.SPDateFormatAn SPDateFormat value that specifies the date and time format.
Return Value
Type: System.String
A string that contains the value in HTML format.