Share via


SPUtility.FormatDate method

Converts the specified date and time value to an SPDateFormat format.

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

Syntax

'Declaration
Public Shared Function FormatDate ( _
    web As SPWeb, _
    date As DateTime, _
    fmt As SPDateFormat _
) As String
'Usage
Dim web As SPWeb
Dim date As DateTime
Dim fmt As SPDateFormat
Dim returnValue As String

returnValue = SPUtility.FormatDate(web, _
    date, fmt)
public static string FormatDate(
    SPWeb web,
    DateTime date,
    SPDateFormat fmt
)

Parameters

  • date
    Type: System.DateTime

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

Return value

Type: System.String
A string that contains the reformatted date and time value.

See also

Reference

SPUtility class

SPUtility members

Microsoft.SharePoint.Utilities namespace