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.DateTime

    A System.DateTime object that represents the DateTime value to convert.

Return Value

Type: System.String
A string that contains the value in HTML format.

See Also

Reference

SPFieldDateTime Class

SPFieldDateTime Members

GetFieldValueAsHtml Overload

Microsoft.SharePoint Namespace