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
dt
Type: System.DateTimeThe DateTime value to evaluate.
hoursMode24
Type: System.Booleantrue to use a 24-hour time format; otherwise, false.
Return Value
Type: System.String
A string that contains the time value.