This documentation is archived and is not being maintained.

SPUtility.FormatDate Method

Windows SharePoint Services 3

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

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

public static string FormatDate(
	SPWeb web,
	DateTime date,
	SPDateFormat fmt
)

Parameters

web
Type: Microsoft.SharePoint.SPWeb
A Microsoft.SharePoint.SPWeb object that represents the site.
date
Type: System.DateTime
A System.DateTime object that represents the value to convert.
fmt
Type: Microsoft.SharePoint.Utilities.SPDateFormat
A 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.
Show: