共用方式為


SPUtility.FormatDate method

將指定的日期與時間值轉換成SPDateFormat格式。

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

Syntax

'宣告
Public Shared Function FormatDate ( _
    web As SPWeb, _
    date As DateTime, _
    fmt As SPDateFormat _
) As String
'用途
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
)

參數

  • date
    Type: System.DateTime

    System.DateTime 物件,代表要轉換的值。

傳回值

Type: System.String
內含重新格式化的日期與時間值的字串。

請參閱

參照

SPUtility class

SPUtility members

Microsoft.SharePoint.Utilities namespace