Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

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)

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:
© 2015 Microsoft