共用方式為


DateOptions.GetTimeStringFromPattern Method

Returns a string representation of a specified DateTime value.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Function GetTimeStringFromPattern ( _
    dt As DateTime, _
    hoursMode24 As Boolean _
) As String
'Usage
Dim instance As DateOptions
Dim dt As DateTime
Dim hoursMode24 As Boolean
Dim returnValue As String

returnValue = instance.GetTimeStringFromPattern(dt, _
    hoursMode24)
public string GetTimeStringFromPattern(
    DateTime dt,
    bool hoursMode24
)

Parameters

  • hoursMode24
    Type: System.Boolean

    true to use a 24-hour time format; otherwise, false.

Return Value

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

See Also

Reference

DateOptions Class

DateOptions Members

Microsoft.SharePoint.Utilities Namespace