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
web
Type: Microsoft.SharePoint.SPWebA Microsoft.SharePoint.SPWeb object that represents the site.
date
Type: System.DateTimeA System.DateTime object that represents the value to convert.
fmt
Type: Microsoft.SharePoint.Utilities.SPDateFormatA Microsoft.SharePoint.Utilities.SPDateFormat value that specifies the new format.
Return value
Type: System.String
A string that contains the reformatted date and time value.